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

Unified Diff: android_webview/browser/aw_content_browser_client.cc

Issue 459953002: Migrate geolocation permissions to the new common permission class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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/browser/aw_content_browser_client.cc
diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc
index 30dd6c33423ae783f1419c947992fabb6d7313a1..268d4e63ee6650a58503d7e55ffea688649edd63 100644
--- a/android_webview/browser/aw_content_browser_client.cc
+++ b/android_webview/browser/aw_content_browser_client.cc
@@ -151,17 +151,6 @@ void CancelProtectedMediaIdentifierPermissionRequests(
delegate->CancelProtectedMediaIdentifierPermissionRequests(origin);
}
-void CancelGeolocationPermissionRequests(
- int render_process_id,
- int render_view_id,
- const GURL& origin) {
- AwBrowserPermissionRequestDelegate* delegate =
- AwBrowserPermissionRequestDelegate::FromID(render_process_id,
- render_view_id);
- if (delegate)
- delegate->CancelGeolocationPermissionRequests(origin);
-}
-
} // namespace
std::string AwContentBrowserClient::GetAcceptLangsImpl() {
@@ -419,8 +408,7 @@ void AwContentBrowserClient::RequestGeolocationPermission(
int bridge_id,
const GURL& requesting_frame,
bool user_gesture,
- base::Callback<void(bool)> result_callback,
- base::Closure* cancel_callback) {
+ const base::Callback<void(bool)>& result_callback) {
int render_process_id = web_contents->GetRenderProcessHost()->GetID();
int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID();
AwBrowserPermissionRequestDelegate* delegate =
@@ -433,14 +421,22 @@ void AwContentBrowserClient::RequestGeolocationPermission(
}
GURL origin = requesting_frame.GetOrigin();
- if (cancel_callback) {
- *cancel_callback = base::Bind(
- CancelGeolocationPermissionRequests, render_process_id, render_view_id,
- origin);
- }
delegate->RequestGeolocationPermission(origin, result_callback);
}
+void AwContentBrowserClient::CancelGeolocationPermissionRequest(
+ content::WebContents* web_contents,
+ int bridge_id,
+ const GURL& requesting_frame) {
+ int render_process_id = web_contents->GetRenderProcessHost()->GetID();
+ int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID();
+ AwBrowserPermissionRequestDelegate* delegate =
+ AwBrowserPermissionRequestDelegate::FromID(render_process_id,
+ render_view_id);
+ if (delegate)
+ delegate->CancelGeolocationPermissionRequests(requesting_frame);
+}
+
void AwContentBrowserClient::RequestMidiSysExPermission(
content::WebContents* web_contents,
int bridge_id,

Powered by Google App Engine
This is Rietveld 408576698