| 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 9652b7e9ef2c5f24ffaaa634bc31ec9b6efccb3d..c41813d9332872faa8adf4b732700ec8320c6bc9 100644
|
| --- a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
|
| +++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
|
| @@ -34,6 +34,7 @@
|
| #include "core/html/HTMLMediaElement.h"
|
| #include "core/html/shadow/MediaControlsWindowEventListener.h"
|
| #include "core/html/track/TextTrackContainer.h"
|
| +#include "core/html/track/TextTrackList.h"
|
| #include "core/layout/LayoutObject.h"
|
| #include "core/layout/LayoutTheme.h"
|
| #include "platform/EventDispatchForbiddenScope.h"
|
| @@ -556,6 +557,24 @@ void MediaControls::toggleTextTrackList() {
|
| m_textTrackList->setVisible(!m_textTrackList->isWanted());
|
| }
|
|
|
| +void MediaControls::showTextTrackAtIndex(unsigned indexToEnable) {
|
| + TextTrackList* trackList = mediaElement().textTracks();
|
| + if (indexToEnable >= trackList->length())
|
| + return;
|
| + TextTrack* track = trackList->anonymousIndexedGetter(indexToEnable);
|
| + if (track && track->canBeRendered())
|
| + track->setMode(TextTrack::showingKeyword());
|
| +}
|
| +
|
| +void MediaControls::disableShowingTextTracks() {
|
| + TextTrackList* trackList = mediaElement().textTracks();
|
| + for (unsigned i = 0; i < trackList->length(); ++i) {
|
| + TextTrack* track = trackList->anonymousIndexedGetter(i);
|
| + if (track->mode() == TextTrack::showingKeyword())
|
| + track->setMode(TextTrack::disabledKeyword());
|
| + }
|
| +}
|
| +
|
| void MediaControls::refreshCastButtonVisibility() {
|
| refreshCastButtonVisibilityWithoutUpdate();
|
| BatchedControlUpdate batch(this);
|
|
|