diff options
author | Steve Block <steveblock@google.com> | 2009-09-02 16:50:51 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-09-02 16:57:47 +0100 |
commit | f7d703686fcbad876e7ce6d21a52d9a6cd71d2e8 (patch) | |
tree | f7ae44c8c7dff6c35f58a0a9a4fe084f57b5e919 /WebKit/android/jni/MockGeolocation.cpp | |
parent | 75310d0981eaef5dfd790e839bf23d7851b68d10 (diff) | |
download | external_webkit-f7d703686fcbad876e7ce6d21a52d9a6cd71d2e8.zip external_webkit-f7d703686fcbad876e7ce6d21a52d9a6cd71d2e8.tar.gz external_webkit-f7d703686fcbad876e7ce6d21a52d9a6cd71d2e8.tar.bz2 |
Brings Mock Geolocation service up to date with latest submission to WebKit.
See https://bugs.webkit.org/show_bug.cgi?id=28264.
Diffstat (limited to 'WebKit/android/jni/MockGeolocation.cpp')
-rwxr-xr-x | WebKit/android/jni/MockGeolocation.cpp | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/WebKit/android/jni/MockGeolocation.cpp b/WebKit/android/jni/MockGeolocation.cpp index 2f6ca60..8c5f966 100755 --- a/WebKit/android/jni/MockGeolocation.cpp +++ b/WebKit/android/jni/MockGeolocation.cpp @@ -30,10 +30,10 @@ #include <JNIHelp.h> #include "Coordinates.h" -#include "GeolocationService.h" #include "Geoposition.h" #include "JavaSharedClient.h" #include "jni_utility.h" +#include "MockGeolocationService.h" #include "PositionError.h" #include "WebCoreJni.h" #include <wtf/CurrentTime.h> @@ -54,31 +54,15 @@ static void setPosition(JNIEnv* env, jobject, double latitude, double longitude, false, 0.0, // heading false, 0.0); // speed RefPtr<Geoposition> position = Geoposition::create(coordinates.release(), WTF::currentTime()); - GeolocationService::setMockPosition(position.release()); + MockGeolocationService::setPosition(position.release()); } static void setError(JNIEnv* env, jobject, int code, jstring message) { - PositionError::ErrorCode codeEnum; - switch (code) { - case PositionError::UNKNOWN_ERROR: - codeEnum = PositionError::UNKNOWN_ERROR; - break; - case PositionError::PERMISSION_DENIED: - codeEnum = PositionError::PERMISSION_DENIED; - break; - case PositionError::POSITION_UNAVAILABLE: - codeEnum = PositionError::POSITION_UNAVAILABLE; - break; - case PositionError::TIMEOUT: - codeEnum = PositionError::TIMEOUT; - break; - default: - ASSERT(false); - } + PositionError::ErrorCode codeEnum = static_cast<PositionError::ErrorCode>(code); String messageString = to_string(env, message); RefPtr<PositionError> error = PositionError::create(codeEnum, messageString); - GeolocationService::setMockError(error.release()); + MockGeolocationService::setError(error.release()); } static JNINativeMethod gMockGeolocationMethods[] = { |