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 17 matching lines...) Expand all Loading... |
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/PlatformEventController.h" | 31 #include "core/frame/PlatformEventController.h" |
32 #include "platform/AsyncMethodRunner.h" | 32 #include "platform/AsyncMethodRunner.h" |
33 #include "platform/Supplementable.h" | 33 #include "platform/Supplementable.h" |
34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
35 #include "public/platform/WebGamepads.h" | 35 #include "public/platform/WebGamepads.h" |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 class WebGamepad; | |
39 class WebGamepads; | |
40 } | |
41 | |
42 namespace blink { | |
43 | 38 |
44 class Document; | 39 class Document; |
45 class Gamepad; | 40 class Gamepad; |
| 41 class Gamepads; |
46 class GamepadList; | 42 class GamepadList; |
47 class Navigator; | 43 class Navigator; |
48 class WebKitGamepadList; | 44 class WebKitGamepadList; |
49 | 45 |
50 class NavigatorGamepad FINAL : public NoBaseWillBeGarbageCollectedFinalized<Navi
gatorGamepad>, public WillBeHeapSupplement<Navigator>, public DOMWindowProperty,
public PlatformEventController, public DOMWindowLifecycleObserver { | 46 class NavigatorGamepad FINAL : public NoBaseWillBeGarbageCollectedFinalized<Navi
gatorGamepad>, public WillBeHeapSupplement<Navigator>, public DOMWindowProperty,
public PlatformEventController, public DOMWindowLifecycleObserver { |
51 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorGamepad); | 47 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorGamepad); |
52 public: | 48 public: |
53 static NavigatorGamepad* from(Document&); | 49 static NavigatorGamepad* from(Document&); |
54 static NavigatorGamepad& from(Navigator&); | 50 static NavigatorGamepad& from(Navigator&); |
55 virtual ~NavigatorGamepad(); | 51 virtual ~NavigatorGamepad(); |
56 | 52 |
57 static WebKitGamepadList* webkitGetGamepads(Navigator&); | 53 static WebKitGamepadList* webkitGetGamepads(Navigator&); |
58 static GamepadList* getGamepads(Navigator&); | 54 static GamepadList* getGamepads(Navigator&); |
59 | 55 |
60 WebKitGamepadList* webkitGamepads(); | 56 WebKitGamepadList* webkitGamepads(); |
61 GamepadList* gamepads(); | 57 GamepadList* gamepads(); |
62 | 58 |
63 virtual void trace(Visitor*); | 59 virtual void trace(Visitor*); |
64 | 60 |
65 void didConnectOrDisconnectGamepad(unsigned index, const blink::WebGamepad&,
bool connected); | 61 void didConnectOrDisconnectGamepad(unsigned index, const WebGamepad&, bool c
onnected); |
66 | 62 |
67 private: | 63 private: |
68 explicit NavigatorGamepad(LocalFrame*); | 64 explicit NavigatorGamepad(LocalFrame*); |
69 | 65 |
70 static const char* supplementName(); | 66 static const char* supplementName(); |
71 | 67 |
72 void dispatchOneEvent(); | 68 void dispatchOneEvent(); |
73 void didRemoveGamepadEventListeners(); | 69 void didRemoveGamepadEventListeners(); |
74 | 70 |
75 // DOMWindowProperty | 71 // DOMWindowProperty |
(...skipping 14 matching lines...) Expand all Loading... |
90 | 86 |
91 PersistentWillBeMember<GamepadList> m_gamepads; | 87 PersistentWillBeMember<GamepadList> m_gamepads; |
92 PersistentWillBeMember<WebKitGamepadList> m_webkitGamepads; | 88 PersistentWillBeMember<WebKitGamepadList> m_webkitGamepads; |
93 PersistentHeapDequeWillBeHeapDeque<Member<Gamepad> > m_pendingEvents; | 89 PersistentHeapDequeWillBeHeapDeque<Member<Gamepad> > m_pendingEvents; |
94 AsyncMethodRunner<NavigatorGamepad> m_dispatchOneEventRunner; | 90 AsyncMethodRunner<NavigatorGamepad> m_dispatchOneEventRunner; |
95 }; | 91 }; |
96 | 92 |
97 } // namespace blink | 93 } // namespace blink |
98 | 94 |
99 #endif // NavigatorGamepad_h | 95 #endif // NavigatorGamepad_h |
OLD | NEW |