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

Unified Diff: android_webview/native/aw_geolocation_permission_context.cc

Issue 12211047: Implementing geolocation for the Android Webview (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added const 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
« no previous file with comments | « android_webview/native/aw_geolocation_permission_context.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_geolocation_permission_context.cc
diff --git a/android_webview/native/aw_geolocation_permission_context.cc b/android_webview/native/aw_geolocation_permission_context.cc
index 959c4647c54dfeeb6fe5201466b3f1057f59fb63..3b67862e2ec8169380dc0da1a97598f6c8d0e82b 100644
--- a/android_webview/native/aw_geolocation_permission_context.cc
+++ b/android_webview/native/aw_geolocation_permission_context.cc
@@ -10,7 +10,6 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
-#include "googleurl/src/gurl.h"
namespace android_webview {
@@ -25,16 +24,14 @@ AwGeolocationPermissionContext::RequestGeolocationPermissionOnUIThread(
const GURL& requesting_frame,
base::Callback<void(bool)> callback) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
- const content::RenderViewHost* host =
- content::RenderViewHost::FromID(render_process_id, render_view_id);
- content::WebContents* web_contents =
- content::WebContents::FromRenderViewHost(host);
- AwContents* aw_contents = AwContents::FromWebContents(web_contents);
- aw_contents->OnGeolocationShowPrompt(
- render_process_id,
- render_view_id,
- bridge_id,
- requesting_frame);
+
+ AwContents* aw_contents =
+ AwContents::FromID(render_process_id, render_view_id);
+ if (!aw_contents) {
+ callback.Run(false);
+ return;
+ }
+ aw_contents->ShowGeolocationPrompt(requesting_frame, callback);
}
void
@@ -70,7 +67,12 @@ AwGeolocationPermissionContext::CancelGeolocationPermissionRequestOnUIThread(
int bridge_id,
const GURL& requesting_frame) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
- // TODO(kristianm): Implement this
+
+ AwContents* aw_contents =
+ AwContents::FromID(render_process_id, render_view_id);
+ if (aw_contents) {
+ aw_contents->HideGeolocationPrompt(requesting_frame);
+ }
}
void
@@ -91,13 +93,4 @@ AwGeolocationPermissionContext::CancelGeolocationPermissionRequest(
requesting_frame));
}
-void InvokeCallback(
- int render_process_id,
- int render_view_id,
- int bridge_id,
- const GURL& requesting_frame,
- bool value) {
- // TODO(kristianm): Implement this
-}
-
} // namespace android_webview
« no previous file with comments | « android_webview/native/aw_geolocation_permission_context.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698