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

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: Updated indenting 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 31a921dc197e2e6e3348772ab85f95c9ea414c2f..9e8c87e0d5a8928f059245fccc5f1db406a3a622 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"
@@ -131,11 +134,12 @@ 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);
@@ -187,6 +191,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;
joth 2013/02/08 02:15:01 add a comment that the Callback<void(bool)> is the
Kristian Monsen 2013/02/12 18:53:03 Done.
+ std::list<OriginCallback> geolocation_callbacks_;
+
// Compositor-specific state.
scoped_ptr<content::Compositor> compositor_;
scoped_refptr<cc::Layer> scissor_clip_layer_;

Powered by Google App Engine
This is Rietveld 408576698