summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/android/GeolocationServiceBridge.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-07-01 02:18:21 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-07-01 02:18:21 -0700
commitf264c97e92357c808f6a6c8d99440cf2d817c34f (patch)
tree2fa28a8c20a463cb32ad87422bbf37431fe5836c /WebCore/platform/android/GeolocationServiceBridge.cpp
parentb34d480cfd791385b567bf371f459ccfa2a3bc34 (diff)
parente07f6aabbe877315688b586c09a36cbe02b7a2a1 (diff)
downloadexternal_webkit-f264c97e92357c808f6a6c8d99440cf2d817c34f.zip
external_webkit-f264c97e92357c808f6a6c8d99440cf2d817c34f.tar.gz
external_webkit-f264c97e92357c808f6a6c8d99440cf2d817c34f.tar.bz2
Merge "Pass the WebView context to the GeolocationService from WebKit"
Diffstat (limited to 'WebCore/platform/android/GeolocationServiceBridge.cpp')
-rw-r--r--WebCore/platform/android/GeolocationServiceBridge.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/WebCore/platform/android/GeolocationServiceBridge.cpp b/WebCore/platform/android/GeolocationServiceBridge.cpp
index be68193..837b338 100644
--- a/WebCore/platform/android/GeolocationServiceBridge.cpp
+++ b/WebCore/platform/android/GeolocationServiceBridge.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "GeolocationServiceBridge.h"
+#include "Frame.h"
#include "GeolocationServiceAndroid.h"
#include "Geoposition.h"
#include "PositionError.h"
@@ -70,12 +71,12 @@ enum javaLocationClassMethods {
};
static jmethodID javaLocationClassMethodIDs[LocationMethodCount];
-GeolocationServiceBridge::GeolocationServiceBridge(ListenerInterface* listener)
+GeolocationServiceBridge::GeolocationServiceBridge(ListenerInterface* listener, Frame* frame)
: m_listener(listener)
, m_javaGeolocationServiceObject(0)
{
ASSERT(m_listener);
- startJavaImplementation();
+ startJavaImplementation(frame);
}
GeolocationServiceBridge::~GeolocationServiceBridge()
@@ -165,7 +166,7 @@ PassRefPtr<Geoposition> GeolocationServiceBridge::toGeoposition(JNIEnv *env, con
env->CallLongMethod(location, javaLocationClassMethodIDs[LocationMethodGetTime]));
}
-void GeolocationServiceBridge::startJavaImplementation()
+void GeolocationServiceBridge::startJavaImplementation(Frame* frame)
{
JNIEnv* env = getJNIEnv();
@@ -175,7 +176,7 @@ void GeolocationServiceBridge::startJavaImplementation()
// Set up the methods we wish to call on the Java GeolocationService class.
javaGeolocationServiceClassMethodIDs[GeolocationServiceMethodInit] =
- env->GetMethodID(javaGeolocationServiceClass, "<init>", "(J)V");
+ env->GetMethodID(javaGeolocationServiceClass, "<init>", "(Landroid/content/Context;J)V");
javaGeolocationServiceClassMethodIDs[GeolocationServiceMethodStart] =
env->GetMethodID(javaGeolocationServiceClass, "start", "()Z");
javaGeolocationServiceClassMethodIDs[GeolocationServiceMethodStop] =
@@ -187,6 +188,7 @@ void GeolocationServiceBridge::startJavaImplementation()
jlong nativeObject = reinterpret_cast<jlong>(this);
jobject object = env->NewObject(javaGeolocationServiceClass,
javaGeolocationServiceClassMethodIDs[GeolocationServiceMethodInit],
+ android::WebViewCore::getWebViewCore(frame->view())->getContext(),
nativeObject);
m_javaGeolocationServiceObject = getJNIEnv()->NewGlobalRef(object);