Index: third_party/WebKit/Source/modules/vr/NavigatorVR.h |
diff --git a/third_party/WebKit/Source/modules/vr/NavigatorVR.h b/third_party/WebKit/Source/modules/vr/NavigatorVR.h |
index b023345f89a5c6f5aa27f291f595be79dcd9fb9a..a88a304a318fc06d683fcb880b648fba403ab537 100644 |
--- a/third_party/WebKit/Source/modules/vr/NavigatorVR.h |
+++ b/third_party/WebKit/Source/modules/vr/NavigatorVR.h |
@@ -8,6 +8,7 @@ |
#include "bindings/core/v8/ScriptPromise.h" |
#include "core/frame/DOMWindowProperty.h" |
#include "core/frame/LocalDOMWindow.h" |
+#include "core/page/PageVisibilityObserver.h" |
#include "modules/ModulesExport.h" |
#include "modules/vr/VRDisplay.h" |
#include "modules/vr/VRDisplayEvent.h" |
@@ -26,6 +27,7 @@ class MODULES_EXPORT NavigatorVR final |
: public GarbageCollectedFinalized<NavigatorVR>, |
public Supplement<Navigator>, |
public DOMWindowProperty, |
+ public PageVisibilityObserver, |
public LocalDOMWindow::EventListenerObserver { |
USING_GARBAGE_COLLECTED_MIXIN(NavigatorVR); |
WTF_MAKE_NONCOPYABLE(NavigatorVR); |
@@ -47,6 +49,9 @@ class MODULES_EXPORT NavigatorVR final |
// Dispatches a user gesture event immediately. |
void dispatchVRGestureEvent(VRDisplayEvent*); |
+ // Inherited from PageVisibilityObserver. |
+ void pageVisibilityChanged() override; |
+ |
// Inherited from LocalDOMWindow::EventListenerObserver. |
void didAddEventListener(LocalDOMWindow*, const AtomicString&) override; |
void didRemoveEventListener(LocalDOMWindow*, const AtomicString&) override; |
@@ -65,6 +70,9 @@ class MODULES_EXPORT NavigatorVR final |
void fireVRDisplayPresentChange(VRDisplay*); |
Member<VRController> m_controller; |
+ |
+ // Whether this page is listening for vrdisplayactivate event. |
+ bool m_listeningForActivate = false; |
}; |
} // namespace blink |