Chromium Code Reviews| Index: Source/modules/gamepad/NavigatorGamepad.h |
| diff --git a/Source/modules/gamepad/NavigatorGamepad.h b/Source/modules/gamepad/NavigatorGamepad.h |
| index 0de60e243802ca9260f0b41096ec7b8a3896e46a..6f9ec626edad1059d838df516ece3da0aeae4880 100644 |
| --- a/Source/modules/gamepad/NavigatorGamepad.h |
| +++ b/Source/modules/gamepad/NavigatorGamepad.h |
| @@ -26,6 +26,8 @@ |
| #ifndef NavigatorGamepad_h |
| #define NavigatorGamepad_h |
| +#include "core/frame/DOMWindowLifecycleObserver.h" |
| +#include "core/frame/DOMWindowProperty.h" |
| #include "heap/Handle.h" |
| #include "platform/Supplementable.h" |
| #include "public/platform/WebGamepads.h" |
| @@ -36,7 +38,7 @@ class GamepadList; |
| class Navigator; |
| class WebKitGamepadList; |
| -class NavigatorGamepad FINAL : public Supplement<Navigator> { |
| +class NavigatorGamepad FINAL : public Supplement<Navigator>, public DOMWindowProperty, public blink::WebGamepadListener, public DOMWindowLifecycleObserver { |
|
abarth-chromium
2014/03/17 18:23:46
You shouldn't need both DOMWindowProperty and DOMW
kbalazs
2014/03/17 23:49:27
I don't need both indeed. I want to start listenin
|
| public: |
| virtual ~NavigatorGamepad(); |
| static NavigatorGamepad& from(Navigator&); |
| @@ -47,8 +49,13 @@ public: |
| WebKitGamepadList* webkitGamepads(); |
| GamepadList* gamepads(); |
| + virtual void onGamepadConnected(unsigned index, const blink::WebGamepad&) OVERRIDE; |
| + virtual void onGamepadDisconnected(unsigned index, const blink::WebGamepad&) OVERRIDE; |
|
abarth-chromium
2014/03/17 18:23:46
We use Obj-C style names:
didConnectGamepad
willD
kbalazs
2014/03/17 23:49:27
Changed to didConnectGamepad and didDisconnectGame
|
| + |
| + virtual void didAddEventListener(DOMWindow*, const AtomicString&) OVERRIDE; |
| + |
| private: |
| - NavigatorGamepad(); |
| + explicit NavigatorGamepad(LocalFrame*); |
| static const char* supplementName(); |
| RefPtrWillBePersistent<GamepadList> m_gamepads; |