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 bd8571576eb5c771654a4e49cc7f1c662a4cb72a..0f55ee62e55e29ed4e3bf2e9e556f39808e72388 100644 |
| --- a/chrome/browser/geolocation/geolocation_permission_context_android.cc |
| +++ b/chrome/browser/geolocation/geolocation_permission_context_android.cc |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Copyright 2012 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -29,16 +29,15 @@ GeolocationPermissionContextAndroid::~GeolocationPermissionContextAndroid() { |
| void GeolocationPermissionContextAndroid::ProceedDecidePermission( |
| content::WebContents* web_contents, |
| const PermissionRequestInfo& info, |
| - const std::string& accept_button_label, |
| base::Callback<void(bool)> callback) { |
| // Super class implementation expects everything in UI thread instead. |
| DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| GeolocationPermissionContext::DecidePermission( |
| web_contents, info.id, info.requesting_frame, info.user_gesture, |
| - info.embedder, accept_button_label, callback); |
| + info.embedder, callback); |
| } |
| -void GeolocationPermissionContextAndroid::CheckMasterLocation( |
| +void GeolocationPermissionContextAndroid::CheckSystemLocation( |
| content::WebContents* web_contents, |
| const PermissionRequestInfo& info, |
| base::Callback<void(bool)> callback) { |
| @@ -46,28 +45,14 @@ void GeolocationPermissionContextAndroid::CheckMasterLocation( |
| // This must happen before other services (e.g. tabs, extensions) |
| // get an opportunity to allow the geolocation request. |
| bool enabled = |
| - google_location_settings_helper_->IsMasterLocationSettingEnabled(); |
| + google_location_settings_helper_->IsMasterLocationSettingEnabled() && |
|
Bernhard Bauer
2014/08/05 12:43:50
Do we need these two separate callbacks now?
(If
Miguel Garcia
2014/08/05 16:19:41
Indeed, let's add the call now, based on those two
|
| + google_location_settings_helper_->IsGoogleAppsLocationSettingEnabled(); |
| - // The flow for geolocation permission on android is: |
| - // - GeolocationPermissionContextAndroid::DecidePermission |
| - // intercepts the flow in the UI thread, and posts task |
| - // to the blocking pool to CheckMasterLocation (in order to |
| - // avoid strict-mode violation). |
| - // - At this point the master location permission is either: |
| - // -- enabled, in which we case it proceeds the normal flow |
| - // via GeolocationPermissionContext (which may create infobars, etc.). |
| - // -- disabled, in which case the permission is already decided. |
| - // |
| - // In either case, GeolocationPermissionContext expects these |
| - // in the UI thread. |
| base::Closure ui_closure; |
| if (enabled) { |
| - bool allow_label = google_location_settings_helper_->IsAllowLabel(); |
| - std::string accept_button_label = |
| - google_location_settings_helper_->GetAcceptButtonLabel(allow_label); |
| ui_closure = base::Bind( |
| &GeolocationPermissionContextAndroid::ProceedDecidePermission, |
| - this, web_contents, info, accept_button_label, callback); |
| + this, web_contents, info, callback); |
| } else { |
| ui_closure = base::Bind( |
| &GeolocationPermissionContextAndroid::PermissionDecided, |
| @@ -86,7 +71,6 @@ void GeolocationPermissionContextAndroid::DecidePermission( |
| const GURL& requesting_frame, |
| bool user_gesture, |
| const GURL& embedder, |
| - const std::string& accept_button_label, |
| base::Callback<void(bool)> callback) { |
| PermissionRequestInfo info; |
| @@ -100,26 +84,6 @@ void GeolocationPermissionContextAndroid::DecidePermission( |
| DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| content::BrowserThread::PostBlockingPoolTask(FROM_HERE, |
| base::Bind( |
| - &GeolocationPermissionContextAndroid::CheckMasterLocation, |
| + &GeolocationPermissionContextAndroid::CheckSystemLocation, |
| this, web_contents, info, callback)); |
| } |
| - |
| -void GeolocationPermissionContextAndroid::PermissionDecided( |
| - const PermissionRequestID& id, |
| - const GURL& requesting_frame, |
| - const GURL& embedder, |
| - base::Callback<void(bool)> callback, |
| - bool allowed) { |
| - // 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_->IsGoogleAppsLocationSettingEnabled()) { |
| - QueueController()->CreateInfoBarRequest( |
| - id, requesting_frame, embedder, "", callback); |
| - return; |
| - } |
| - |
| - GeolocationPermissionContext::PermissionDecided( |
| - id, requesting_frame, embedder, callback, allowed); |
| -} |