Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/MediaCustomControlsFullscreenDetector.h |
| diff --git a/third_party/WebKit/Source/core/html/MediaCustomControlsFullscreenDetector.h b/third_party/WebKit/Source/core/html/MediaCustomControlsFullscreenDetector.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c37d6b664c0e47f9e00565ae1ae19482c86091f6 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/html/MediaCustomControlsFullscreenDetector.h |
| @@ -0,0 +1,58 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MediaCustomControlsFullscreenDetector_h |
| +#define MediaCustomControlsFullscreenDetector_h |
| + |
| +#include "core/CoreExport.h" |
| +#include "core/events/EventListener.h" |
| +#include "platform/Timer.h" |
| + |
| +namespace blink { |
| + |
| +class Document; |
| +class HTMLVideoElement; |
| +class IntRect; |
| +class TimerBase; |
| + |
| +class CORE_EXPORT MediaCustomControlsFullscreenDetector final |
| + : public EventListener { |
| + public: |
|
mlamouri (slow - plz ping)
2017/02/27 18:04:55
Add WTF_MAKE_NONCOPYABLE() above `public:`?
Zhiqiang Zhang (Slow)
2017/02/28 12:16:52
Done.
|
| + explicit MediaCustomControlsFullscreenDetector(HTMLVideoElement&); |
| + |
| + // EventListener implementation. |
| + bool operator==(const EventListener&) const override; |
| + |
| + HTMLVideoElement& videoElement() { return *m_videoElement; } |
|
mlamouri (slow - plz ping)
2017/02/27 18:04:55
could this be private?
Zhiqiang Zhang (Slow)
2017/02/28 12:16:52
Done.
|
| + |
| + void didMoveToNewDocument(Document& oldDocument); |
| + |
| + DECLARE_VIRTUAL_TRACE(); |
| + |
| + private: |
| + friend class MediaCustomControlsFullscreenDetectorTest; |
| + |
| + // EventListener implementation. |
| + void handleEvent(ExecutionContext*, Event*) override; |
| + |
| + bool onEnterFullscreen(); |
| + bool onExitFullscreen(); |
|
mlamouri (slow - plz ping)
2017/02/27 18:04:55
these are not implemented it looks like
Zhiqiang Zhang (Slow)
2017/02/28 12:16:52
Removed.
|
| + |
| + void onCheckViewportIntersectionTimerFired(TimerBase*); |
| + |
| + bool isVideoOrParentFullscreen(); |
| + |
| + static bool computeIsDominantVideo(const IntRect& targetRect, |
|
mlamouri (slow - plz ping)
2017/02/27 18:04:55
Maybe leave a note that this is visible for tests?
Zhiqiang Zhang (Slow)
2017/02/28 12:16:52
Using name `computeIsDominantVideoForTests()`. Cal
|
| + const IntRect& rootRect, |
| + const IntRect& intersectionRect); |
| + |
| + // `m_videoElement` owns |this|. |
| + Member<HTMLVideoElement> m_videoElement; |
| + TaskRunnerTimer<MediaCustomControlsFullscreenDetector> |
| + m_checkViewportIntersectionTimer; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // MediaCustomControlsFullscreenDetector_h |