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