Chromium Code Reviews| Index: chrome/browser/geolocation/geolocation_permission_context_android.h |
| diff --git a/chrome/browser/geolocation/geolocation_permission_context_android.h b/chrome/browser/geolocation/geolocation_permission_context_android.h |
| index 24337f9cd6ecaf5997d16c598bd5d0bf5671dd0e..4236f89a86fd540f4d1f4556f223e3ecf6fc81a5 100644 |
| --- a/chrome/browser/geolocation/geolocation_permission_context_android.h |
| +++ b/chrome/browser/geolocation/geolocation_permission_context_android.h |
| @@ -1,10 +1,32 @@ |
| -// 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. |
| #ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_ |
| #define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_ |
| +// The flow for geolocation permissions on android needs to take into account |
|
Bernhard Bauer
2014/08/05 12:43:50
Nit: Android is capitalized.
Miguel Garcia
2014/08/05 16:19:41
Done.
|
| +// the global geolocation settings so it differs from the desktop one. It |
| +// works as follows. |
| +// - GeolocationPermissionContextAndroid::DecidePermission |
|
Bernhard Bauer
2014/08/05 12:43:50
Nit: This should be either indented to match the o
Miguel Garcia
2014/08/05 16:19:41
Done.
|
| +// intercepts the flow in the UI thread, and posts a task |
| +// to the blocking pool to CheckSystemLocation. |
| +// CheckSystemLocation will in fact check several possible settings |
| +// - The global system geolocation setting |
| +// - The Google location settings on pre KK devices |
| +// - An old internal Chrome setting on pre-JB MR1 devices |
| +// With all that information it will decide if system location is enabled. |
| +// If enabled, it proceeds with the per site flow |
| +// via GeolocationPermissionContext (which will check per site permissions, |
| +// create infobars, etc.). |
| +// |
| +// Otherwise the permission is already decided. |
| + |
| +// There is a bit of thread jumping since some of the permissions |
| +// (like the per site settings) are queried on the UX thread while the |
|
Bernhard Bauer
2014/08/05 12:43:50
Nit: "UI thread"
Miguel Garcia
2014/08/05 16:19:41
Done.
|
| +// system level permissions are considered I/O and thus checked in the |
| +// blocking thread pool. |
| + |
| #include "chrome/browser/content_settings/permission_request_id.h" |
| #include "chrome/browser/geolocation/geolocation_permission_context.h" |
| #include "url/gurl.h" |
| @@ -15,8 +37,7 @@ class WebContents; |
| class GoogleLocationSettingsHelper; |
| -// Android-specific geolocation permission flow, taking into account the |
| -// Google Location Settings, if available. |
| + |
| class GeolocationPermissionContextAndroid |
| : public GeolocationPermissionContext { |
| public: |
| @@ -42,24 +63,16 @@ class GeolocationPermissionContextAndroid |
| const GURL& requesting_frame, |
| bool user_gesture, |
| const GURL& embedder, |
| - const std::string& accept_button_label, |
| base::Callback<void(bool)> callback) OVERRIDE; |
| - virtual void PermissionDecided(const PermissionRequestID& id, |
| - const GURL& requesting_frame, |
| - const GURL& embedder, |
| - base::Callback<void(bool)> callback, |
| - bool allowed) OVERRIDE; |
| - |
| void ProceedDecidePermission(content::WebContents* web_contents, |
| const PermissionRequestInfo& info, |
| - const std::string& accept_button_label, |
| base::Callback<void(bool)> callback); |
| scoped_ptr<GoogleLocationSettingsHelper> google_location_settings_helper_; |
| private: |
| - void CheckMasterLocation(content::WebContents* web_contents, |
| + void CheckSystemLocation(content::WebContents* web_contents, |
| const PermissionRequestInfo& info, |
| base::Callback<void(bool)> callback); |