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

Unified Diff: chrome/browser/geolocation/geolocation_permission_context_extensions.cc

Issue 955383003: ContentBrowserClient::RequestPermission replies with PermissionStatus instead of bool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android geolocation breakage Created 5 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: chrome/browser/geolocation/geolocation_permission_context_extensions.cc
diff --git a/chrome/browser/geolocation/geolocation_permission_context_extensions.cc b/chrome/browser/geolocation/geolocation_permission_context_extensions.cc
index 884562588ef4c949f59427ebf73a0bc139ef7835..15a32092a6d6cc4d7e61b5fee8a55ffcc4ed16b4 100644
--- a/chrome/browser/geolocation/geolocation_permission_context_extensions.cc
+++ b/chrome/browser/geolocation/geolocation_permission_context_extensions.cc
@@ -20,6 +20,18 @@ using extensions::APIPermission;
using extensions::ExtensionRegistry;
#endif
+namespace {
+
+#if ENABLE_EXTENSIONS
+void CallbackContentSettingWrapper(
+ const base::Callback<void(ContentSetting)>& callback,
+ bool allowed) {
+ callback.Run(allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK);
+}
+#endif // ENABLE_EXTENSIONS
+
+} // anonymous namespace
+
GeolocationPermissionContextExtensions::
GeolocationPermissionContextExtensions(Profile* profile)
: profile_(profile) {
@@ -35,7 +47,7 @@ bool GeolocationPermissionContextExtensions::RequestPermission(
int bridge_id,
const GURL& requesting_frame,
bool user_gesture,
- base::Callback<void(bool)> callback,
+ const base::Callback<void(ContentSetting)>& callback,
bool* permission_set,
bool* new_permission) {
#if defined(ENABLE_EXTENSIONS)
@@ -45,7 +57,8 @@ bool GeolocationPermissionContextExtensions::RequestPermission(
extensions::WebViewPermissionHelper::FromWebContents(web_contents);
if (web_view_permission_helper) {
web_view_permission_helper->RequestGeolocationPermission(
- bridge_id, requesting_frame, user_gesture, callback);
+ bridge_id, requesting_frame, user_gesture,
+ base::Bind(&CallbackContentSettingWrapper, callback));
*permission_set = false;
*new_permission = false;
return true;

Powered by Google App Engine
This is Rietveld 408576698