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

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: rebase 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 6af10e61ff6c1d4c765d79c3b38c8c838c4f3bf3..8385cc98f9e9282aee31cf7580541a303cb61133 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/content_settings/permission_request_id.h"
#include "chrome/browser/geolocation/geolocation_permission_context.h"
#include "url/gurl.h"
@@ -35,44 +37,46 @@ 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,
- const PermissionRequestInfo& info,
- base::Callback<void(bool)> callback);
DISALLOW_COPY_AND_ASSIGN(GeolocationPermissionContextAndroid);
};

Powered by Google App Engine
This is Rietveld 408576698