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

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

Issue 852593002: Allow overriding GoogleLocationSettingsHelper for tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 ea02ca6e7c559495e9c672a5f8d3ec676e8fd1fe..3eeb700c64bbe397fba43eaf0b8ef15bac3bcb4e 100644
--- a/chrome/browser/geolocation/geolocation_permission_context_android.h
+++ b/chrome/browser/geolocation/geolocation_permission_context_android.h
@@ -25,6 +25,10 @@
// 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.
+// TODO(newt): investigate the comment above about threading. AFAICT, system
+// level permission checks actually happen on the UI thread, though they jump
+// through the IO thread unnecessarily. This should be fixed.
+
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/geolocation/geolocation_permission_context.h"
@@ -44,6 +48,8 @@ class GeolocationPermissionContextAndroid
virtual ~GeolocationPermissionContextAndroid();
private:
+ friend class GeolocationPermissionContextTests;
+
struct PermissionRequestInfo {
PermissionRequestInfo();
@@ -74,6 +80,11 @@ class GeolocationPermissionContextAndroid
void InterceptPermissionCheck(const BrowserPermissionCallback& callback,
bool granted);
+ // Overrides the GoogleLocationSettingsHelper used to determine whether
+ // system and Chrome-wide location permissions are enabled.
+ void SetGoogleLocationSettingsHelperForTest(
Michael van Ouwerkerk 2015/01/13 16:33:48 Nit: ForTesting - http://www.chromium.org/develop
newt (away) 2015/01/13 16:55:03 Done.
+ scoped_ptr<GoogleLocationSettingsHelper>& helper);
Michael van Ouwerkerk 2015/01/13 16:33:47 scoped_ptr should not be a reference - http://www.
newt (away) 2015/01/13 16:55:03 Done.
+
scoped_ptr<GoogleLocationSettingsHelper> google_location_settings_helper_;
base::WeakPtrFactory<GeolocationPermissionContextAndroid> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698