Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(473)

Unified Diff: android_webview/native/aw_contents.h

Issue 12211047: Implementing geolocation for the Android Webview (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor style updates Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/native/aw_contents.h
diff --git a/android_webview/native/aw_contents.h b/android_webview/native/aw_contents.h
index 6747ac7373e7e7440aa038781e2185bdde42a030..03f5b7291170021870700b375747527978887dc2 100644
--- a/android_webview/native/aw_contents.h
+++ b/android_webview/native/aw_contents.h
@@ -6,7 +6,9 @@
#define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_
#include <jni.h>
+#include <list>
#include <string>
+#include <utility>
#include "android_webview/browser/find_helper.h"
#include "android_webview/browser/icon_helper.h"
@@ -14,6 +16,7 @@
#include "android_webview/public/browser/draw_gl.h"
#include "base/android/scoped_java_ref.h"
#include "base/android/jni_helper.h"
+#include "base/callback_forward.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/android/compositor.h"
#include "content/public/browser/javascript_dialog_manager.h"
@@ -127,11 +130,10 @@ class AwContents : public FindHelper::Listener,
jboolean invalidation_only);
// Geolocation API support
- void OnGeolocationShowPrompt(int render_process_id,
- int render_view_id,
- int bridge_id,
- const GURL& requesting_frame);
- void OnGeolocationHidePrompt();
+ void OnGeolocationShowPrompt(const GURL& origin, base::Callback<void(bool)>);
+ void OnGeolocationHidePrompt(const GURL& origin);
+ void InvokeGeolocationCallback(
+ JNIEnv* env, jobject obj, jboolean value, jstring origin);
// Find-in-page API and related methods.
jint FindAllSync(JNIEnv* env, jobject obj, jstring search_string);
@@ -183,6 +185,9 @@ class AwContents : public FindHelper::Listener,
scoped_ptr<IconHelper> icon_helper_;
scoped_ptr<content::WebContents> pending_contents_;
+ typedef std::pair<const GURL&, base::Callback<void(bool)> > OriginCallback;
+ std::list<OriginCallback> geolocation_callbacks_;
boliu 2013/02/06 20:29:54 man this just begs for a native->java callback tra
Kristian Monsen 2013/02/08 00:07:44 The problem here is that these have to be stored n
+
// Compositor-specific state.
scoped_ptr<content::Compositor> compositor_;
scoped_refptr<cc::Layer> scissor_clip_layer_;

Powered by Google App Engine
This is Rietveld 408576698