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

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

Issue 1240923002: Add an infobar to resolve android runtime permission mismatches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address dfalcantara@ comment Created 5 years, 5 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 db24bfbe2d1cf1ff7322c05c8ca44ae4725932d5..23918318936489709a85cc3ef1e62fd7862aecdd 100644
--- a/chrome/browser/geolocation/geolocation_permission_context_android.h
+++ b/chrome/browser/geolocation/geolocation_permission_context_android.h
@@ -21,6 +21,7 @@
//
// Otherwise the permission is already decided.
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/geolocation/geolocation_permission_context.h"
namespace content {
@@ -43,10 +44,16 @@ class GeolocationPermissionContextAndroid
// GeolocationPermissionContext:
void RequestPermission(
content::WebContents* web_contents,
- const PermissionRequestID& id,
- const GURL& requesting_frame_origin,
- bool user_gesture,
- const BrowserPermissionCallback& callback) override;
+ const PermissionRequestID& id,
+ const GURL& requesting_frame_origin,
+ bool user_gesture,
+ const BrowserPermissionCallback& callback) override;
+
+ void HandleUpdateAndroidPermissions(const PermissionRequestID& id,
+ const GURL& requesting_frame_origin,
+ const GURL& embedding_origin,
+ const BrowserPermissionCallback& callback,
+ bool permissions_updated);
// Overrides the LocationSettings object used to determine whether
// system and Chrome-wide location permissions are enabled.
@@ -54,6 +61,10 @@ class GeolocationPermissionContextAndroid
scoped_ptr<LocationSettings> location_settings_;
+ // Must be the last member, to ensure that it will be destroyed first, which
+ // will invalidate weak pointers.
+ base::WeakPtrFactory<GeolocationPermissionContextAndroid> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(GeolocationPermissionContextAndroid);
};

Powered by Google App Engine
This is Rietveld 408576698