diff options
author | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-01 11:31:00 +0000 |
---|---|---|
committer | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-01 11:31:00 +0000 |
commit | 1642c6086d35b6767c07eca51d23af8ca6d4f3b7 (patch) | |
tree | ce445b2f39cb80f159f4f99e6977851df0bb6cf2 /chrome/browser/geolocation/mock_location_provider.h | |
parent | 25212c49c8dff853bb05e52ed4629a8c659004a5 (diff) | |
download | chromium_src-1642c6086d35b6767c07eca51d23af8ca6d4f3b7.zip chromium_src-1642c6086d35b6767c07eca51d23af8ca6d4f3b7.tar.gz chromium_src-1642c6086d35b6767c07eca51d23af8ca6d4f3b7.tar.bz2 |
Defer sending wifi data via the network provider until permission has been granted to use geolocaiton.
Also fixes a long standing todos/bugs that the host sent in the network request was not set correctly, and
location results were not always tagged against the correct source data in the cache.
BUG=39171
TEST=run with --geolocation-enabled and --log-level=0, check from logs that no location request sent until authorized.
Review URL: http://codereview.chromium.org/1541008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43339 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/geolocation/mock_location_provider.h')
-rw-r--r-- | chrome/browser/geolocation/mock_location_provider.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/browser/geolocation/mock_location_provider.h b/chrome/browser/geolocation/mock_location_provider.h index b690416..50b454b 100644 --- a/chrome/browser/geolocation/mock_location_provider.h +++ b/chrome/browser/geolocation/mock_location_provider.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ #include "chrome/browser/geolocation/location_provider.h" +#include "googleurl/src/gurl.h" // Mock implementation of a location provider for testing. class MockLocationProvider : public LocationProviderBase { @@ -18,10 +19,12 @@ class MockLocationProvider : public LocationProviderBase { // LocationProviderBase implementation. virtual bool StartProvider(); - virtual void GetPosition(Geoposition *position); + virtual void GetPosition(Geoposition* position); + virtual void OnPermissionGranted(const GURL& requesting_frame); Geoposition position_; int started_count_; + GURL permission_granted_url_; // Set when an instance of the mock is created via a factory function. static MockLocationProvider* instance_; @@ -42,5 +45,9 @@ LocationProviderBase* NewAutoSuccessMockLocationProvider(); // Creates a mock location provider that automatically notifies its // listeners with an error when StartProvider is called. LocationProviderBase* NewAutoFailMockLocationProvider(); +// Similar to NewAutoSuccessMockLocationProvider but mimicks the behavior of +// the Network Location provider, in deferring making location updates until +// a permission request has been confirmed. +LocationProviderBase* NewAutoSuccessMockNetworkLocationProvider(); #endif // CHROME_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ |