OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 MediaCustomControlsFullscreenDetector_h | 5 #ifndef MediaCustomControlsFullscreenDetector_h |
6 #define MediaCustomControlsFullscreenDetector_h | 6 #define MediaCustomControlsFullscreenDetector_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/dom/ContextLifecycleObserver.h" | |
10 #include "core/events/EventListener.h" | 9 #include "core/events/EventListener.h" |
11 #include "platform/Timer.h" | 10 #include "platform/Timer.h" |
12 | 11 |
13 namespace blink { | 12 namespace blink { |
14 | 13 |
15 class HTMLVideoElement; | 14 class HTMLVideoElement; |
16 class IntRect; | 15 class IntRect; |
17 class TimerBase; | 16 class TimerBase; |
18 | 17 |
19 class CORE_EXPORT MediaCustomControlsFullscreenDetector final | 18 class CORE_EXPORT MediaCustomControlsFullscreenDetector final |
20 : public EventListener, | 19 : public EventListener { |
21 public ContextLifecycleObserver { | |
22 USING_GARBAGE_COLLECTED_MIXIN(MediaCustomControlsFullscreenDetector); | |
23 WTF_MAKE_NONCOPYABLE(MediaCustomControlsFullscreenDetector); | 20 WTF_MAKE_NONCOPYABLE(MediaCustomControlsFullscreenDetector); |
24 | 21 |
25 public: | 22 public: |
26 explicit MediaCustomControlsFullscreenDetector(HTMLVideoElement&); | 23 explicit MediaCustomControlsFullscreenDetector(HTMLVideoElement&); |
27 | 24 |
28 // EventListener implementation. | 25 // EventListener implementation. |
29 bool operator==(const EventListener&) const override; | 26 bool operator==(const EventListener&) const override; |
30 | 27 |
31 // ContextLifecycleObserver implemnetation. | 28 void contextDestroyed(); |
32 void contextDestroyed(ExecutionContext*); | |
33 | 29 |
34 DECLARE_VIRTUAL_TRACE(); | 30 DECLARE_VIRTUAL_TRACE(); |
35 | 31 |
36 private: | 32 private: |
37 friend class MediaCustomControlsFullscreenDetectorTest; | 33 friend class MediaCustomControlsFullscreenDetectorTest; |
38 friend class HTMLMediaElementEventListenersTest; | 34 friend class HTMLMediaElementEventListenersTest; |
39 | 35 |
40 // EventListener implementation. | 36 // EventListener implementation. |
41 void handleEvent(ExecutionContext*, Event*) override; | 37 void handleEvent(ExecutionContext*, Event*) override; |
42 | 38 |
(...skipping 12 matching lines...) Expand all Loading... |
55 | 51 |
56 // `m_videoElement` owns |this|. | 52 // `m_videoElement` owns |this|. |
57 Member<HTMLVideoElement> m_videoElement; | 53 Member<HTMLVideoElement> m_videoElement; |
58 TaskRunnerTimer<MediaCustomControlsFullscreenDetector> | 54 TaskRunnerTimer<MediaCustomControlsFullscreenDetector> |
59 m_checkViewportIntersectionTimer; | 55 m_checkViewportIntersectionTimer; |
60 }; | 56 }; |
61 | 57 |
62 } // namespace blink | 58 } // namespace blink |
63 | 59 |
64 #endif // MediaCustomControlsFullscreenDetector_h | 60 #endif // MediaCustomControlsFullscreenDetector_h |
OLD | NEW |