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

Unified Diff: chrome/browser/geolocation/geolocation_permission_context_android.h

Issue 459953002: Migrate geolocation permissions to the new common permission class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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_android.h
diff --git a/chrome/browser/geolocation/geolocation_permission_context_android.h b/chrome/browser/geolocation/geolocation_permission_context_android.h
index f9eadf91fb95e3e604a9134f6fce8d6bb34c4569..1443fc06f4de5f7e1e2a8c72606ad63927644844 100644
--- a/chrome/browser/geolocation/geolocation_permission_context_android.h
+++ b/chrome/browser/geolocation/geolocation_permission_context_android.h
@@ -25,6 +25,8 @@
// per site settings) are queried on the UI thread while the system level
// permissions are considered I/O and thus checked in the blocking thread pool.
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/geolocation/geolocation_permission_context.h"
#include "components/content_settings/core/common/permission_request_id.h"
#include "url/gurl.h"
@@ -35,39 +37,45 @@ class WebContents;
class GoogleLocationSettingsHelper;
-
class GeolocationPermissionContextAndroid
: public GeolocationPermissionContext {
public:
explicit GeolocationPermissionContextAndroid(Profile* profile);
+ virtual ~GeolocationPermissionContextAndroid();
private:
struct PermissionRequestInfo {
PermissionRequestInfo();
PermissionRequestID id;
- GURL requesting_frame;
+ GURL requesting_origin;
+ GURL embedder_origin;
bool user_gesture;
- GURL embedder;
};
- friend class GeolocationPermissionContext;
-
- virtual ~GeolocationPermissionContextAndroid();
+ // PermissionContextBase:
+ virtual void RequestPermission(
+ content::WebContents* web_contents,
+ const PermissionRequestID& id,
+ const GURL& requesting_frame_origin,
+ bool user_gesture,
+ const BrowserPermissionCallback& callback) OVERRIDE;
- // GeolocationPermissionContext implementation:
- virtual void DecidePermission(content::WebContents* web_contents,
- const PermissionRequestID& id,
- const GURL& requesting_frame,
- bool user_gesture,
- const GURL& embedder,
- base::Callback<void(bool)> callback) OVERRIDE;
+ void CheckMasterLocation(content::WebContents* web_contents,
+ const PermissionRequestInfo& info,
+ const BrowserPermissionCallback& callback);
void ProceedDecidePermission(content::WebContents* web_contents,
const PermissionRequestInfo& info,
base::Callback<void(bool)> callback);
+ // Will perform a final check on the system location settings before
+ // granting the permission.
+ void InterceptPermissionCheck(const BrowserPermissionCallback& callback,
+ bool granted);
+
scoped_ptr<GoogleLocationSettingsHelper> google_location_settings_helper_;
+ base::WeakPtrFactory<GeolocationPermissionContextAndroid> weak_factory_;
private:
void CheckSystemLocation(content::WebContents* web_contents,

Powered by Google App Engine
This is Rietveld 408576698