| 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 20 matching lines...) Expand all Loading... |
| 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 | 38 |
| 39 class Document; | 39 class Document; |
| 40 class Gamepad; | 40 class Gamepad; |
| 41 class GamepadList; | |
| 42 class Navigator; | 41 class Navigator; |
| 43 | 42 |
| 44 class NavigatorGamepad final : public NoBaseWillBeGarbageCollectedFinalized<Navi
gatorGamepad>, public WillBeHeapSupplement<Navigator>, public DOMWindowProperty,
public PlatformEventController, public DOMWindowLifecycleObserver { | 43 class NavigatorGamepad final : public NoBaseWillBeGarbageCollectedFinalized<Navi
gatorGamepad>, public WillBeHeapSupplement<Navigator>, public DOMWindowProperty,
public PlatformEventController, public DOMWindowLifecycleObserver { |
| 45 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorGamepad); | 44 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorGamepad); |
| 46 public: | 45 public: |
| 47 static NavigatorGamepad* from(Document&); | 46 static NavigatorGamepad* from(Document&); |
| 48 static NavigatorGamepad& from(Navigator&); | 47 static NavigatorGamepad& from(Navigator&); |
| 49 virtual ~NavigatorGamepad(); | 48 virtual ~NavigatorGamepad(); |
| 50 | 49 |
| 51 static GamepadList* getGamepads(Navigator&); | 50 static HeapVector<Member<Gamepad>> getGamepads(Navigator&); |
| 52 GamepadList* gamepads(); | 51 HeapVector<Member<Gamepad>> getGamepads(); |
| 53 | 52 |
| 54 virtual void trace(Visitor*); | 53 virtual void trace(Visitor*); |
| 55 | 54 |
| 56 void didConnectOrDisconnectGamepad(unsigned index, const WebGamepad&, bool c
onnected); | 55 void didConnectOrDisconnectGamepad(unsigned index, const WebGamepad&, bool c
onnected); |
| 57 | 56 |
| 58 private: | 57 private: |
| 59 explicit NavigatorGamepad(LocalFrame*); | 58 explicit NavigatorGamepad(LocalFrame*); |
| 60 | 59 |
| 61 static const char* supplementName(); | 60 static const char* supplementName(); |
| 62 | 61 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 73 virtual void unregisterWithDispatcher() override; | 72 virtual void unregisterWithDispatcher() override; |
| 74 virtual bool hasLastData() override; | 73 virtual bool hasLastData() override; |
| 75 virtual void didUpdateData() override; | 74 virtual void didUpdateData() override; |
| 76 virtual void pageVisibilityChanged() override; | 75 virtual void pageVisibilityChanged() override; |
| 77 | 76 |
| 78 // DOMWindowLifecycleObserver | 77 // DOMWindowLifecycleObserver |
| 79 virtual void didAddEventListener(LocalDOMWindow*, const AtomicString&) overr
ide; | 78 virtual void didAddEventListener(LocalDOMWindow*, const AtomicString&) overr
ide; |
| 80 virtual void didRemoveEventListener(LocalDOMWindow*, const AtomicString&) ov
erride; | 79 virtual void didRemoveEventListener(LocalDOMWindow*, const AtomicString&) ov
erride; |
| 81 virtual void didRemoveAllEventListeners(LocalDOMWindow*) override; | 80 virtual void didRemoveAllEventListeners(LocalDOMWindow*) override; |
| 82 | 81 |
| 83 PersistentWillBeMember<GamepadList> m_gamepads; | 82 //PersistentWillBeMember<GamepadList> m_gamepads; |
| 84 PersistentHeapDequeWillBeHeapDeque<Member<Gamepad>> m_pendingEvents; | 83 PersistentHeapDequeWillBeHeapDeque<Member<Gamepad>> m_pendingEvents; |
| 85 AsyncMethodRunner<NavigatorGamepad> m_dispatchOneEventRunner; | 84 AsyncMethodRunner<NavigatorGamepad> m_dispatchOneEventRunner; |
| 86 }; | 85 }; |
| 87 | 86 |
| 88 } // namespace blink | 87 } // namespace blink |
| 89 | 88 |
| 90 #endif // NavigatorGamepad_h | 89 #endif // NavigatorGamepad_h |
| OLD | NEW |