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

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControls.cpp

Issue 2592443002: Media Controls: use events to enter/exit fullscreen. (Closed)
Patch Set: rebase Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
index bd03224eddbf5a30289fc42bcf28e9116ab52fdb..cf9626ce0095e2ee396c6529efbffd17b481c6bd 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
@@ -354,6 +354,7 @@ void MediaControls::reset() {
onTextTracksAddedOrRemoved();
m_fullscreenButton->setIsWanted(shouldShowFullscreenButton(mediaElement()));
+ m_fullscreenButton->setIsFullscreen(mediaElement().isFullscreen());
refreshCastButtonVisibilityWithoutUpdate();
@@ -549,18 +550,6 @@ void MediaControls::exitFullscreen() {
Fullscreen::exitFullscreen(document());
}
-void MediaControls::enteredFullscreen() {
- m_fullscreenButton->setIsFullscreen(true);
- stopHideMediaControlsTimer();
- startHideMediaControlsTimer();
-}
-
-void MediaControls::exitedFullscreen() {
- m_fullscreenButton->setIsFullscreen(false);
- stopHideMediaControlsTimer();
- startHideMediaControlsTimer();
-}
-
void MediaControls::startedCasting() {
m_castButton->setIsPlayingRemotely(true);
m_overlayCastButton->setIsPlayingRemotely(true);
@@ -760,6 +749,18 @@ void MediaControls::onLoadedMetadata() {
reset();
}
+void MediaControls::onEnteredFullscreen() {
+ m_fullscreenButton->setIsFullscreen(true);
+ stopHideMediaControlsTimer();
+ startHideMediaControlsTimer();
+}
+
+void MediaControls::onExitedFullscreen() {
+ m_fullscreenButton->setIsFullscreen(false);
+ stopHideMediaControlsTimer();
+ startHideMediaControlsTimer();
+}
+
void MediaControls::notifyPanelWidthChanged(const LayoutUnit& newWidth) {
// Don't bother to do any work if this matches the most recent panel
// width, since we're called after layout.

Powered by Google App Engine
This is Rietveld 408576698