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

Unified Diff: content/browser/geolocation/geolocation_dispatcher_host.h

Issue 603323004: DevTools: Add geolocation override in browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Expanded SetOverride description. Created 6 years, 2 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: content/browser/geolocation/geolocation_dispatcher_host.h
diff --git a/content/browser/geolocation/geolocation_dispatcher_host.h b/content/browser/geolocation/geolocation_dispatcher_host.h
index 36c7030d1c096a4cf916671a878384bbe9077b01..7806f1a56429feb56c0c2bc0938119d3a37ccffb 100644
--- a/content/browser/geolocation/geolocation_dispatcher_host.h
+++ b/content/browser/geolocation/geolocation_dispatcher_host.h
@@ -30,6 +30,13 @@ class GeolocationDispatcherHost : public WebContentsObserver {
// geolocation updates until it is resumed.
void PauseOrResume(bool should_pause);
+ // Enables geolocation override. This method is used by DevTools to
+ // trigger possible location-specific behavior in particular web contents.
+ void SetOverride(scoped_ptr<Geoposition> geoposition);
+
+ // Disables geolocation override.
+ void ClearOverride();
+
private:
// WebContentsObserver
virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) override;
@@ -56,6 +63,7 @@ class GeolocationDispatcherHost : public WebContentsObserver {
void RefreshGeolocationOptions();
void OnLocationUpdate(const Geoposition& position);
+ void UpdateGeoposition(RenderFrameHost* frame, const Geoposition& position);
void SendGeolocationPermissionResponse(int render_process_id,
int render_frame_id,
@@ -79,6 +87,7 @@ class GeolocationDispatcherHost : public WebContentsObserver {
std::vector<PendingPermission> pending_permissions_;
scoped_ptr<GeolocationProvider::Subscription> geolocation_subscription_;
+ scoped_ptr<Geoposition> geoposition_override_;
base::WeakPtrFactory<GeolocationDispatcherHost> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698