Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(988)

Side by Side Diff: third_party/WebKit/Source/core/html/MediaCustomControlsFullscreenDetector.h

Issue 2696893002: [Blink>Media] Add heuristic for dominant video detection for Android (Closed)
Patch Set: addressed nits Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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:
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.
22 explicit MediaCustomControlsFullscreenDetector(HTMLVideoElement&);
23
24 // EventListener implementation.
25 bool operator==(const EventListener&) const override;
26
27 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.
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();
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.
41
42 void onCheckViewportIntersectionTimerFired(TimerBase*);
43
44 bool isVideoOrParentFullscreen();
45
46 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698