| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NavigatorVR_h | 5 #ifndef NavigatorVR_h |
| 6 #define NavigatorVR_h | 6 #define NavigatorVR_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "core/dom/ContextLifecycleObserver.h" | |
| 10 #include "core/frame/LocalDOMWindow.h" | 9 #include "core/frame/LocalDOMWindow.h" |
| 11 #include "core/frame/Navigator.h" | 10 #include "core/frame/Navigator.h" |
| 12 #include "core/page/PageVisibilityObserver.h" | 11 #include "core/page/PageVisibilityObserver.h" |
| 13 #include "modules/ModulesExport.h" | 12 #include "modules/ModulesExport.h" |
| 14 #include "modules/vr/VRDisplay.h" | 13 #include "modules/vr/VRDisplay.h" |
| 15 #include "modules/vr/VRDisplayEvent.h" | 14 #include "modules/vr/VRDisplayEvent.h" |
| 16 #include "platform/Supplementable.h" | 15 #include "platform/Supplementable.h" |
| 17 #include "platform/heap/Handle.h" | 16 #include "platform/heap/Handle.h" |
| 18 #include "public/platform/WebVector.h" | 17 #include "public/platform/WebVector.h" |
| 19 #include "wtf/Noncopyable.h" | 18 #include "wtf/Noncopyable.h" |
| 20 | 19 |
| 21 namespace blink { | 20 namespace blink { |
| 22 | 21 |
| 23 class Document; | 22 class Document; |
| 24 class Navigator; | 23 class Navigator; |
| 25 class VRController; | 24 class VRController; |
| 26 | 25 |
| 27 class MODULES_EXPORT NavigatorVR final | 26 class MODULES_EXPORT NavigatorVR final |
| 28 : public GarbageCollectedFinalized<NavigatorVR>, | 27 : public GarbageCollectedFinalized<NavigatorVR>, |
| 29 public Supplement<Navigator>, | 28 public Supplement<Navigator>, |
| 30 public ContextClient, | |
| 31 public PageVisibilityObserver, | 29 public PageVisibilityObserver, |
| 32 public LocalDOMWindow::EventListenerObserver { | 30 public LocalDOMWindow::EventListenerObserver { |
| 33 USING_GARBAGE_COLLECTED_MIXIN(NavigatorVR); | 31 USING_GARBAGE_COLLECTED_MIXIN(NavigatorVR); |
| 34 WTF_MAKE_NONCOPYABLE(NavigatorVR); | 32 WTF_MAKE_NONCOPYABLE(NavigatorVR); |
| 35 | 33 |
| 36 public: | 34 public: |
| 37 static NavigatorVR* from(Document&); | 35 static NavigatorVR* from(Document&); |
| 38 static NavigatorVR& from(Navigator&); | 36 static NavigatorVR& from(Navigator&); |
| 39 virtual ~NavigatorVR(); | 37 virtual ~NavigatorVR(); |
| 40 | 38 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 57 void didAddEventListener(LocalDOMWindow*, const AtomicString&) override; | 55 void didAddEventListener(LocalDOMWindow*, const AtomicString&) override; |
| 58 void didRemoveEventListener(LocalDOMWindow*, const AtomicString&) override; | 56 void didRemoveEventListener(LocalDOMWindow*, const AtomicString&) override; |
| 59 void didRemoveAllEventListeners(LocalDOMWindow*) override; | 57 void didRemoveAllEventListeners(LocalDOMWindow*) override; |
| 60 | 58 |
| 61 DECLARE_VIRTUAL_TRACE(); | 59 DECLARE_VIRTUAL_TRACE(); |
| 62 | 60 |
| 63 private: | 61 private: |
| 64 friend class VRDisplay; | 62 friend class VRDisplay; |
| 65 friend class VRGetDevicesCallback; | 63 friend class VRGetDevicesCallback; |
| 66 | 64 |
| 67 explicit NavigatorVR(LocalFrame*); | 65 explicit NavigatorVR(Navigator&); |
| 68 | 66 |
| 69 static const char* supplementName(); | 67 static const char* supplementName(); |
| 70 | 68 |
| 71 void fireVRDisplayPresentChange(VRDisplay*); | 69 void fireVRDisplayPresentChange(VRDisplay*); |
| 72 | 70 |
| 73 Member<VRController> m_controller; | 71 Member<VRController> m_controller; |
| 74 | 72 |
| 75 // Whether this page is listening for vrdisplayactivate event. | 73 // Whether this page is listening for vrdisplayactivate event. |
| 76 bool m_listeningForActivate = false; | 74 bool m_listeningForActivate = false; |
| 77 }; | 75 }; |
| 78 | 76 |
| 79 } // namespace blink | 77 } // namespace blink |
| 80 | 78 |
| 81 #endif // NavigatorVR_h | 79 #endif // NavigatorVR_h |
| OLD | NEW |