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

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

Issue 2301823002: Reordering media controls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@media-controls
Patch Set: addressed comments Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/media/video-controls-track-selection-menu.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 07680f612b45c082052028ebb7049fbafde1689b..9c3498337f7f96d2a59ce0b17a0482a39be3f3b9 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
@@ -223,14 +223,6 @@ void MediaControls::initializeControls()
if (m_allowHiddenVolumeControls && preferHiddenVolumeControls(document()))
m_volumeSlider->setIsWanted(false);
- MediaControlToggleClosedCaptionsButtonElement* toggleClosedCaptionsButton = MediaControlToggleClosedCaptionsButtonElement::create(*this);
- m_toggleClosedCaptionsButton = toggleClosedCaptionsButton;
- panel->appendChild(toggleClosedCaptionsButton);
-
- MediaControlCastButtonElement* castButton = MediaControlCastButtonElement::create(*this, false);
- m_castButton = castButton;
- panel->appendChild(castButton);
-
MediaControlFullscreenButtonElement* fullscreenButton = MediaControlFullscreenButtonElement::create(*this);
m_fullscreenButton = fullscreenButton;
panel->appendChild(fullscreenButton);
@@ -239,6 +231,14 @@ void MediaControls::initializeControls()
m_downloadButton = downloadButton;
panel->appendChild(downloadButton);
+ MediaControlCastButtonElement* castButton = MediaControlCastButtonElement::create(*this, false);
+ m_castButton = castButton;
+ panel->appendChild(castButton);
+
+ MediaControlToggleClosedCaptionsButtonElement* toggleClosedCaptionsButton = MediaControlToggleClosedCaptionsButtonElement::create(*this);
+ m_toggleClosedCaptionsButton = toggleClosedCaptionsButton;
+ panel->appendChild(toggleClosedCaptionsButton);
+
m_panel = panel;
enclosure->appendChild(panel);
@@ -257,13 +257,15 @@ void MediaControls::initializeControls()
m_overflowList = overflowList;
appendChild(overflowList);
- // The order in which we append elements to the overflow list does matter.
+ // The order in which we append elements to the overflow list is significant
+ // because it determines how the elements show up in the overflow menu relative to each other.
+ // The first item appended appears at the top of the overflow menu.
+ m_overflowList->appendChild(m_playButton->createOverflowElement(*this, MediaControlPlayButtonElement::create(*this)));
+ m_overflowList->appendChild(m_fullscreenButton->createOverflowElement(*this, MediaControlFullscreenButtonElement::create(*this)));
+ m_overflowList->appendChild(m_downloadButton->createOverflowElement(*this, MediaControlDownloadButtonElement::create(*this)));
m_overflowList->appendChild(m_muteButton->createOverflowElement(*this, MediaControlMuteButtonElement::create(*this)));
m_overflowList->appendChild(m_castButton->createOverflowElement(*this, MediaControlCastButtonElement::create(*this, false)));
m_overflowList->appendChild(m_toggleClosedCaptionsButton->createOverflowElement(*this, MediaControlToggleClosedCaptionsButtonElement::create(*this)));
- m_overflowList->appendChild(m_fullscreenButton->createOverflowElement(*this, MediaControlFullscreenButtonElement::create(*this)));
- m_overflowList->appendChild(m_playButton->createOverflowElement(*this, MediaControlPlayButtonElement::create(*this)));
- m_overflowList->appendChild(m_downloadButton->createOverflowElement(*this, MediaControlDownloadButtonElement::create(*this)));
}
void MediaControls::reset()
@@ -716,12 +718,12 @@ void MediaControls::computeWhichControlsFit()
m_playButton.get(),
m_fullscreenButton.get(),
m_downloadButton.get(),
- m_toggleClosedCaptionsButton.get(),
m_timeline.get(),
- m_currentTimeDisplay.get(),
+ m_muteButton.get(),
m_volumeSlider.get(),
+ m_toggleClosedCaptionsButton.get(),
m_castButton.get(),
- m_muteButton.get(),
+ m_currentTimeDisplay.get(),
m_durationDisplay.get(),
};
« no previous file with comments | « third_party/WebKit/LayoutTests/media/video-controls-track-selection-menu.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698