| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MediaCustomControlsFullscreenDetector_h |
| 6 #define MediaCustomControlsFullscreenDetector_h |
| 7 |
| 8 #include "core/CoreExport.h" |
| 9 #include "core/events/EventListener.h" |
| 10 #include "platform/Timer.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 class HTMLVideoElement; |
| 15 class IntRect; |
| 16 class TimerBase; |
| 17 |
| 18 class CORE_EXPORT MediaCustomControlsFullscreenDetector final |
| 19 : public EventListener { |
| 20 WTF_MAKE_NONCOPYABLE(MediaCustomControlsFullscreenDetector); |
| 21 |
| 22 public: |
| 23 explicit MediaCustomControlsFullscreenDetector(HTMLVideoElement&); |
| 24 |
| 25 // EventListener implementation. |
| 26 bool operator==(const EventListener&) const override; |
| 27 |
| 28 DECLARE_VIRTUAL_TRACE(); |
| 29 |
| 30 private: |
| 31 friend class MediaCustomControlsFullscreenDetectorTest; |
| 32 |
| 33 // EventListener implementation. |
| 34 void handleEvent(ExecutionContext*, Event*) override; |
| 35 |
| 36 void attach(); |
| 37 void detach(); |
| 38 |
| 39 HTMLVideoElement& videoElement() { return *m_videoElement; } |
| 40 |
| 41 void onCheckViewportIntersectionTimerFired(TimerBase*); |
| 42 |
| 43 bool isVideoOrParentFullscreen(); |
| 44 |
| 45 static bool computeIsDominantVideoForTests(const IntRect& targetRect, |
| 46 const IntRect& rootRect, |
| 47 const IntRect& intersectionRect); |
| 48 |
| 49 // `m_videoElement` owns |this|. |
| 50 Member<HTMLVideoElement> m_videoElement; |
| 51 TaskRunnerTimer<MediaCustomControlsFullscreenDetector> |
| 52 m_checkViewportIntersectionTimer; |
| 53 }; |
| 54 |
| 55 } // namespace blink |
| 56 |
| 57 #endif // MediaCustomControlsFullscreenDetector_h |
| OLD | NEW |