Chromium Code Reviews| Index: chrome/browser/geolocation/geolocation_permission_context_android.cc |
| diff --git a/chrome/browser/geolocation/geolocation_permission_context_android.cc b/chrome/browser/geolocation/geolocation_permission_context_android.cc |
| index 65c96efb575e6ba09718d82990e8a8fd93f33080..18404852ba65e40710b7a4b28a2be29e4030c089 100644 |
| --- a/chrome/browser/geolocation/geolocation_permission_context_android.cc |
| +++ b/chrome/browser/geolocation/geolocation_permission_context_android.cc |
| @@ -10,8 +10,10 @@ |
| #include "base/bind.h" |
| #include "chrome/browser/android/location_settings.h" |
| #include "chrome/browser/android/location_settings_impl.h" |
| +#include "chrome/browser/android/search_geolocation/search_geolocation_service.h" |
| #include "chrome/browser/permissions/permission_request_id.h" |
| #include "chrome/browser/permissions/permission_update_infobar_delegate_android.h" |
| +#include "chrome/browser/profiles/profile.h" |
| #include "components/infobars/core/infobar.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/web_contents.h" |
| @@ -28,6 +30,31 @@ GeolocationPermissionContextAndroid:: |
| GeolocationPermissionContextAndroid::~GeolocationPermissionContextAndroid() { |
| } |
| +ContentSetting GeolocationPermissionContextAndroid::GetPermissionStatusInternal( |
| + const GURL& requesting_origin, |
| + const GURL& embedding_origin) const { |
| + ContentSetting value = |
| + GeolocationPermissionContext::GetPermissionStatusInternal( |
| + requesting_origin, embedding_origin); |
| + |
| + if (value == CONTENT_SETTING_ASK) { |
| + // Consult the DSE Geolocation setting. Note that this only needs to be |
| + // consulted when the content setting is ASK. In the other cases (ALLOW or |
| + // BLOCK) checking the setting is redundant, as the setting is kept |
| + // consistent with the content setting. |
| + SearchGeolocationService* search_helper = |
| + SearchGeolocationService::Factory::GetForBrowserContext(profile()); |
| + if (search_helper && |
| + search_helper->UseDSEGeolocationSetting( |
| + url::Origin(embedding_origin))) { |
|
raymes
2017/01/10 03:19:32
I think we only want to do this if requesting_orig
benwells
2017/01/11 05:35:32
Done.
|
| + value = search_helper->GetDSEGeolocationSetting() ? CONTENT_SETTING_ALLOW |
| + : CONTENT_SETTING_BLOCK; |
| + } |
| + } |
| + |
| + return value; |
| +} |
| + |
| void GeolocationPermissionContextAndroid::RequestPermission( |
| content::WebContents* web_contents, |
| const PermissionRequestID& id, |