Index: chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc |
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc |
index 18906d17f7222cc9bcfbcec7dbad7a72b96ff55e..d0ddecf4352def028eaa18835b7cf831f7cd627f 100644 |
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc |
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc |
@@ -4,6 +4,7 @@ |
#include "chrome/browser/geolocation/chrome_geolocation_permission_context_android.h" |
+#include "chrome/browser/android/google_location_settings_helper.h" |
#include "chrome/browser/prefs/pref_service.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/common/pref_names.h" |
@@ -11,7 +12,8 @@ |
ChromeGeolocationPermissionContextAndroid:: |
ChromeGeolocationPermissionContextAndroid(Profile* profile) |
- : ChromeGeolocationPermissionContext(profile) { |
+ : ChromeGeolocationPermissionContext(profile), |
+ google_location_settings_helper_(new GoogleLocationSettingsHelper()) { |
} |
void ChromeGeolocationPermissionContextAndroid::DecidePermission( |
@@ -36,3 +38,28 @@ void ChromeGeolocationPermissionContextAndroid::DecidePermission( |
render_process_id, render_view_id, bridge_id, |
requesting_frame, embedder, callback); |
} |
+ |
+void ChromeGeolocationPermissionContextAndroid::PermissionDecided( |
+ int render_process_id, |
+ int render_view_id, |
+ int bridge_id, |
+ const GURL& requesting_frame, |
+ const GURL& embedder, |
+ base::Callback<void(bool)> callback, |
+ bool allowed) { |
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
+ // If Google Apps Location setting is turned off then we ignore |
+ // the 'allow' website setting for this site and instead show |
+ // the infobar to go back to the 'settings' to turn it back on. |
+ if (allowed && |
+ !google_location_settings_helper_->IsPlatformSettingEnabled()) { |
+ QueueController()->CreateInfoBarRequest( |
+ render_process_id, render_view_id, bridge_id, requesting_frame, |
+ embedder, callback); |
+ return; |
+ } |
+ |
+ ChromeGeolocationPermissionContext::PermissionDecided( |
+ render_process_id, render_view_id, bridge_id, |
+ requesting_frame, embedder, callback, allowed); |
+} |