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

Unified Diff: third_party/WebKit/Source/modules/vr/NavigatorVR.h

Issue 2668003003: Provide WebVR pose data only to the focused frame. (Closed)
Patch Set: Address comments Created 3 years, 10 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: 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 a4d5a38b16ef9a72b3b8683dacb840f3d939dfaf..dfe54720c8f93d2cfb3a5fc860ddd0da94e6f462 100644
--- a/third_party/WebKit/Source/modules/vr/NavigatorVR.h
+++ b/third_party/WebKit/Source/modules/vr/NavigatorVR.h
@@ -8,7 +8,7 @@
#include "bindings/core/v8/ScriptPromise.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/frame/Navigator.h"
-#include "core/page/PageVisibilityObserver.h"
+#include "core/page/FocusChangedObserver.h"
#include "modules/ModulesExport.h"
#include "modules/vr/VRDisplay.h"
#include "modules/vr/VRDisplayEvent.h"
@@ -26,8 +26,8 @@ class VRController;
class MODULES_EXPORT NavigatorVR final
: public GarbageCollectedFinalized<NavigatorVR>,
public Supplement<Navigator>,
- public PageVisibilityObserver,
- public LocalDOMWindow::EventListenerObserver {
+ public LocalDOMWindow::EventListenerObserver,
+ public FocusChangedObserver {
USING_GARBAGE_COLLECTED_MIXIN(NavigatorVR);
WTF_MAKE_NONCOPYABLE(NavigatorVR);
@@ -41,6 +41,7 @@ class MODULES_EXPORT NavigatorVR final
VRController* controller();
Document* document();
+ bool isFocused() { return m_focused; }
// Queues up event to be fired soon.
void enqueueVREvent(VRDisplayEvent*);
@@ -48,8 +49,8 @@ class MODULES_EXPORT NavigatorVR final
// Dispatches a user gesture event immediately.
void dispatchVRGestureEvent(VRDisplayEvent*);
- // Inherited from PageVisibilityObserver.
- void pageVisibilityChanged() override;
+ // Inherited from FocusChangedObserver.
+ void focusedFrameChanged() override;
// Inherited from LocalDOMWindow::EventListenerObserver.
void didAddEventListener(LocalDOMWindow*, const AtomicString&) override;
@@ -72,6 +73,7 @@ class MODULES_EXPORT NavigatorVR final
// Whether this page is listening for vrdisplayactivate event.
bool m_listeningForActivate = false;
+ bool m_focused = false;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/page/FocusController.cpp ('k') | third_party/WebKit/Source/modules/vr/NavigatorVR.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698