| Index: Source/core/html/shadow/MediaControls.cpp
|
| diff --git a/Source/core/html/shadow/MediaControls.cpp b/Source/core/html/shadow/MediaControls.cpp
|
| index b0560f11dddbc156a7e77c71ccca1c75b39140a6..99635c94f1a9d17670da57f3891674602ee159eb 100644
|
| --- a/Source/core/html/shadow/MediaControls.cpp
|
| +++ b/Source/core/html/shadow/MediaControls.cpp
|
| @@ -59,6 +59,7 @@ MediaControls::MediaControls(HTMLMediaElement& mediaElement)
|
| , m_muteButton(nullptr)
|
| , m_volumeSlider(nullptr)
|
| , m_toggleClosedCaptionsButton(nullptr)
|
| + , m_textTrackList(nullptr)
|
| , m_fullScreenButton(nullptr)
|
| , m_castButton(nullptr)
|
| , m_overlayCastButton(nullptr)
|
| @@ -95,6 +96,7 @@ PassRefPtrWillBeRawPtr<MediaControls> MediaControls::create(HTMLMediaElement& me
|
| // +-MediaControlMuteButtonElement (-webkit-media-controls-mute-button)
|
| // +-MediaControlVolumeSliderElement (-webkit-media-controls-volume-slider)
|
| // +-MediaControlToggleClosedCaptionsButtonElement (-webkit-media-controls-toggle-closed-captions-button)
|
| +// +-MediaControlTextTrackListElement (-webkit-media-controls-text-track-list)
|
| // +-MediaControlCastButtonElement (-internal-media-controls-cast-button)
|
| // \-MediaControlFullscreenButtonElement (-webkit-media-controls-fullscreen-button)
|
| void MediaControls::initializeControls()
|
| @@ -159,6 +161,11 @@ void MediaControls::initializeControls()
|
| m_panel = panel.get();
|
| enclosure->appendChild(panel.release());
|
|
|
| + RefPtrWillBeRawPtr<MediaControlTextTrackListElement> textTrackList =
|
| + MediaControlTextTrackListElement::create(*this);
|
| + m_textTrackList = textTrackList.get();
|
| + enclosure->appendChild(textTrackList.release());
|
| +
|
| m_enclosure = enclosure.get();
|
| appendChild(enclosure.release());
|
| }
|
| @@ -354,6 +361,19 @@ void MediaControls::refreshClosedCaptionsButtonVisibility()
|
| m_toggleClosedCaptionsButton->hide();
|
| }
|
|
|
| +void MediaControls::toggleTextTrackList()
|
| +{
|
| + if (!mediaElement().hasClosedCaptions())
|
| + return;
|
| +
|
| + if (m_textTrackList->isVisible()) {
|
| + m_textTrackList->hide();
|
| + } else {
|
| + m_textTrackList->refreshTextTrackListMenu();
|
| + m_textTrackList->show();
|
| + }
|
| +}
|
| +
|
| static Element* elementFromCenter(Element& element)
|
| {
|
| RefPtrWillBeRawPtr<ClientRect> clientRect = element.getBoundingClientRect();
|
|
|