| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 MediaControlsWindowEventListener_h | 5 #ifndef MediaControlsWindowEventListener_h |
| 6 #define MediaControlsWindowEventListener_h | 6 #define MediaControlsWindowEventListener_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" |
| 8 #include "core/events/EventListener.h" | 9 #include "core/events/EventListener.h" |
| 9 #include "wtf/Functional.h" | 10 #include "wtf/Functional.h" |
| 10 | 11 |
| 11 namespace blink { | 12 namespace blink { |
| 12 | 13 |
| 13 class MediaControls; | 14 class MediaControls; |
| 14 | 15 |
| 15 class MediaControlsWindowEventListener final : public EventListener { | 16 class CORE_EXPORT MediaControlsWindowEventListener final |
| 17 : public EventListener { |
| 16 public: | 18 public: |
| 17 using Callback = Function<void(), WTF::SameThreadAffinity>; | 19 using Callback = Function<void(), WTF::SameThreadAffinity>; |
| 18 | 20 |
| 19 static MediaControlsWindowEventListener* create(MediaControls*, | 21 static MediaControlsWindowEventListener* create(MediaControls*, |
| 20 std::unique_ptr<Callback>); | 22 std::unique_ptr<Callback>); |
| 21 | 23 |
| 22 bool operator==(const EventListener&) const override; | 24 bool operator==(const EventListener&) const override; |
| 23 | 25 |
| 24 void start(); | 26 void start(); |
| 25 void stop(); | 27 void stop(); |
| 26 | 28 |
| 27 DECLARE_VIRTUAL_TRACE(); | 29 DECLARE_VIRTUAL_TRACE(); |
| 28 | 30 |
| 29 private: | 31 private: |
| 30 explicit MediaControlsWindowEventListener(MediaControls*, | 32 explicit MediaControlsWindowEventListener(MediaControls*, |
| 31 std::unique_ptr<Callback>); | 33 std::unique_ptr<Callback>); |
| 32 | 34 |
| 33 void handleEvent(ExecutionContext*, Event*) override; | 35 void handleEvent(ExecutionContext*, Event*) override; |
| 34 | 36 |
| 35 Member<MediaControls> m_mediaControls; | 37 Member<MediaControls> m_mediaControls; |
| 36 std::unique_ptr<Callback> m_callback; | 38 std::unique_ptr<Callback> m_callback; |
| 37 bool m_isActive; | 39 bool m_isActive; |
| 38 }; | 40 }; |
| 39 | 41 |
| 40 } // namespace blink | 42 } // namespace blink |
| 41 | 43 |
| 42 #endif // MediaControlsWindowEventListener_h | 44 #endif // MediaControlsWindowEventListener_h |
| OLD | NEW |