OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are met: | 5 * modification, are permitted provided that the following conditions are met: |
6 * | 6 * |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 10 matching lines...) Expand all Loading... | |
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
23 * DAMAGE. | 23 * DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef NavigatorGamepad_h | 26 #ifndef NavigatorGamepad_h |
27 #define NavigatorGamepad_h | 27 #define NavigatorGamepad_h |
28 | 28 |
29 #include "core/frame/DOMWindowLifecycleObserver.h" | 29 #include "core/frame/DOMWindowLifecycleObserver.h" |
30 #include "core/frame/DOMWindowProperty.h" | 30 #include "core/frame/DOMWindowProperty.h" |
31 #include "core/frame/DeviceSensorEventController.h" | 31 #include "core/frame/DeviceEventControllerBase.h" |
32 #include "platform/Supplementable.h" | 32 #include "platform/Supplementable.h" |
33 #include "platform/heap/Handle.h" | 33 #include "platform/heap/Handle.h" |
34 #include "public/platform/WebGamepads.h" | 34 #include "public/platform/WebGamepads.h" |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 class WebGamepad; | 37 class WebGamepad; |
38 class WebGamepads; | 38 class WebGamepads; |
39 } | 39 } |
40 | 40 |
41 namespace WebCore { | 41 namespace WebCore { |
42 | 42 |
43 class Document; | |
44 class Event; | |
timvolodine
2014/06/16 13:05:17
is this necessary?
| |
43 class GamepadList; | 45 class GamepadList; |
44 class Navigator; | 46 class Navigator; |
45 class WebKitGamepadList; | 47 class WebKitGamepadList; |
46 | 48 |
47 class NavigatorGamepad FINAL : public NoBaseWillBeGarbageCollectedFinalized<Navi gatorGamepad>, public WillBeHeapSupplement<Navigator>, public DOMWindowProperty, public DeviceSensorEventController, public DOMWindowLifecycleObserver { | 49 class NavigatorGamepad FINAL : public NoBaseWillBeGarbageCollectedFinalized<Navi gatorGamepad>, public WillBeHeapSupplement<Navigator>, public DOMWindowProperty, public DeviceEventControllerBase, public DOMWindowLifecycleObserver { |
48 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorGamepad); | 50 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorGamepad); |
49 public: | 51 public: |
50 static NavigatorGamepad* from(Document&); | 52 static NavigatorGamepad* from(Document&); |
51 static NavigatorGamepad& from(Navigator&); | 53 static NavigatorGamepad& from(Navigator&); |
52 virtual ~NavigatorGamepad(); | 54 virtual ~NavigatorGamepad(); |
53 | 55 |
54 static WebKitGamepadList* webkitGetGamepads(Navigator&); | 56 static WebKitGamepadList* webkitGetGamepads(Navigator&); |
55 static GamepadList* getGamepads(Navigator&); | 57 static GamepadList* getGamepads(Navigator&); |
56 | 58 |
57 WebKitGamepadList* webkitGamepads(); | 59 WebKitGamepadList* webkitGamepads(); |
58 GamepadList* gamepads(); | 60 GamepadList* gamepads(); |
59 | 61 |
60 virtual void trace(Visitor*); | 62 virtual void trace(Visitor*); |
61 | 63 |
62 void didConnectOrDisconnectGamepad(unsigned index, const blink::WebGamepad&, bool connected); | 64 void didConnectOrDisconnectGamepad(unsigned index, const blink::WebGamepad&, bool connected); |
63 | 65 |
64 private: | 66 private: |
65 explicit NavigatorGamepad(LocalFrame*); | 67 explicit NavigatorGamepad(LocalFrame*); |
66 | 68 |
67 static const char* supplementName(); | 69 static const char* supplementName(); |
68 | 70 |
69 // DOMWindowProperty | 71 // DOMWindowProperty |
70 virtual void willDestroyGlobalObjectInFrame() OVERRIDE; | 72 virtual void willDestroyGlobalObjectInFrame() OVERRIDE; |
71 virtual void willDetachGlobalObjectFromFrame() OVERRIDE; | 73 virtual void willDetachGlobalObjectFromFrame() OVERRIDE; |
72 | 74 |
73 // DeviceSensorEventController | 75 // DeviceEventControllerBase |
74 virtual void registerWithDispatcher() OVERRIDE; | 76 virtual void registerWithDispatcher() OVERRIDE; |
75 virtual void unregisterWithDispatcher() OVERRIDE; | 77 virtual void unregisterWithDispatcher() OVERRIDE; |
76 virtual bool hasLastData() OVERRIDE; | 78 virtual bool hasLastData() OVERRIDE; |
77 virtual PassRefPtrWillBeRawPtr<Event> getLastEvent() OVERRIDE; | 79 virtual void didUpdateData() OVERRIDE; |
78 virtual bool isNullEvent(Event*) OVERRIDE; | |
79 virtual Document* document() OVERRIDE; | |
80 | 80 |
81 // DOMWindowLifecycleObserver | 81 // DOMWindowLifecycleObserver |
82 virtual void didAddEventListener(DOMWindow*, const AtomicString&) OVERRIDE; | 82 virtual void didAddEventListener(DOMWindow*, const AtomicString&) OVERRIDE; |
83 virtual void didRemoveEventListener(DOMWindow*, const AtomicString&) OVERRID E; | 83 virtual void didRemoveEventListener(DOMWindow*, const AtomicString&) OVERRID E; |
84 virtual void didRemoveAllEventListeners(DOMWindow*) OVERRIDE; | 84 virtual void didRemoveAllEventListeners(DOMWindow*) OVERRIDE; |
85 | 85 |
86 PersistentWillBeMember<GamepadList> m_gamepads; | 86 PersistentWillBeMember<GamepadList> m_gamepads; |
87 PersistentWillBeMember<WebKitGamepadList> m_webkitGamepads; | 87 PersistentWillBeMember<WebKitGamepadList> m_webkitGamepads; |
88 }; | 88 }; |
89 | 89 |
90 } // namespace WebCore | 90 } // namespace WebCore |
91 | 91 |
92 #endif // NavigatorGamepad_h | 92 #endif // NavigatorGamepad_h |
OLD | NEW |