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

Unified Diff: Source/modules/geolocation/GeolocationController.h

Issue 27368003: Add page visibility observer for Geolocation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nit Created 7 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: Source/modules/geolocation/GeolocationController.h
diff --git a/Source/modules/geolocation/GeolocationController.h b/Source/modules/geolocation/GeolocationController.h
index 1cd817c92187139c26a5e1b1133eb0ef8c6fdbf3..ba1617438ad759ce07cd133eddbb7ff303e33c27 100644
--- a/Source/modules/geolocation/GeolocationController.h
+++ b/Source/modules/geolocation/GeolocationController.h
@@ -27,6 +27,7 @@
#define GeolocationController_h
#include "core/page/Page.h"
+#include "core/page/PageLifecycleObserver.h"
#include "modules/geolocation/Geolocation.h"
#include "wtf/HashSet.h"
#include "wtf/Noncopyable.h"
@@ -39,7 +40,7 @@ class GeolocationError;
class GeolocationPosition;
class Page;
-class GeolocationController : public Supplement<Page> {
+class GeolocationController : public Supplement<Page>, public PageLifecycleObserver {
WTF_MAKE_NONCOPYABLE(GeolocationController);
public:
~GeolocationController();
@@ -59,6 +60,9 @@ public:
GeolocationClient* client() { return m_client; }
+ // Inherited from PageLifecycleObserver.
+ virtual void pageVisibilityChanged() OVERRIDE;
+
static const char* supplementName();
static GeolocationController* from(Page* page) { return static_cast<GeolocationController*>(Supplement<Page>::from(page, supplementName())); }
@@ -66,7 +70,6 @@ private:
GeolocationController(Page*, GeolocationClient*);
GeolocationClient* m_client;
- Page* m_page;
RefPtr<GeolocationPosition> m_lastPosition;
typedef HashSet<RefPtr<Geolocation> > ObserversSet;

Powered by Google App Engine
This is Rietveld 408576698