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

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

Issue 2539023002: Media Controls: Use events to update controls for closed captions. (Closed)
Patch Set: review comments 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 5b4b0b7b707d21ec773acb1c80f361aa5d401624..b46bd4bbd0ed33023260755a9a82acbe5107aec7 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
@@ -339,8 +339,7 @@ void MediaControls::reset() {
m_timeline->setPosition(mediaElement().currentTime());
onVolumeChange();
-
- refreshClosedCaptionsButtonVisibility();
+ onTextTracksAddedOrRemoved();
m_fullscreenButton->setIsWanted(shouldShowFullscreenButton(mediaElement()));
@@ -454,15 +453,6 @@ void MediaControls::updateCurrentTimeDisplay() {
m_currentTimeDisplay->setCurrentValue(now);
}
-void MediaControls::changedClosedCaptionsVisibility() {
- m_toggleClosedCaptionsButton->updateDisplayType();
-}
-
-void MediaControls::refreshClosedCaptionsButtonVisibility() {
- m_toggleClosedCaptionsButton->setIsWanted(mediaElement().hasClosedCaptions());
- BatchedControlUpdate batch(this);
-}
-
void MediaControls::toggleTextTrackList() {
if (!mediaElement().hasClosedCaptions()) {
m_textTrackList->setVisible(false);
@@ -724,6 +714,15 @@ void MediaControls::onPause() {
stopHideMediaControlsTimer();
}
+void MediaControls::onTextTracksAddedOrRemoved() {
+ m_toggleClosedCaptionsButton->setIsWanted(mediaElement().hasClosedCaptions());
+ BatchedControlUpdate batch(this);
+}
+
+void MediaControls::onTextTracksChanged() {
+ m_toggleClosedCaptionsButton->updateDisplayType();
+}
+
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