| 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 Document; |
| 15 class HTMLVideoElement; |
| 16 class IntRect; |
| 17 class TimerBase; |
| 18 |
| 19 class CORE_EXPORT MediaCustomControlsFullscreenDetector final |
| 20 : public EventListener { |
| 21 public: |
| 22 explicit MediaCustomControlsFullscreenDetector(HTMLVideoElement&); |
| 23 |
| 24 // EventListener implementation. |
| 25 bool operator==(const EventListener&) const override; |
| 26 |
| 27 HTMLVideoElement& videoElement() { return *m_videoElement; } |
| 28 |
| 29 void didMoveToNewDocument(Document& oldDocument); |
| 30 |
| 31 DECLARE_VIRTUAL_TRACE(); |
| 32 |
| 33 private: |
| 34 friend class MediaCustomControlsFullscreenDetectorTest; |
| 35 |
| 36 // EventListener implementation. |
| 37 void handleEvent(ExecutionContext*, Event*) override; |
| 38 |
| 39 bool onEnterFullscreen(); |
| 40 bool onExitFullscreen(); |
| 41 |
| 42 void onCheckViewportIntersectionTimerFired(TimerBase*); |
| 43 |
| 44 bool isVideoOrParentFullscreen(); |
| 45 |
| 46 static bool computeIsDominantVideo(const IntRect& targetRect, |
| 47 const IntRect& rootRect, |
| 48 const IntRect& intersectionRect); |
| 49 |
| 50 // `m_videoElement` owns |this|. |
| 51 Member<HTMLVideoElement> m_videoElement; |
| 52 TaskRunnerTimer<MediaCustomControlsFullscreenDetector> |
| 53 m_checkViewportIntersectionTimer; |
| 54 }; |
| 55 |
| 56 } // namespace blink |
| 57 |
| 58 #endif // MediaCustomControlsFullscreenDetector_h |
| OLD | NEW |