| 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 13bce37f2d2d4004b57a6c8b9f40677489c1cdad..593f1283dd96298ca3d2d5475a3a5383df75f609 100644
|
| --- a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
|
| +++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
|
| @@ -681,6 +681,27 @@ bool MediaControls::containsRelatedTarget(Event* event) {
|
| return contains(relatedTarget->toNode());
|
| }
|
|
|
| +void MediaControls::onInsertedIntoDocument() {
|
| + // TODO(mlamouri): we should show the controls instead of having
|
| + // HTMLMediaElement do it.
|
| +
|
| + // m_windowEventListener doesn't need to be re-attached as it's only needed
|
| + // when a menu is visible.
|
| + m_mediaEventListener->attach();
|
| + if (m_orientationLockDelegate)
|
| + m_orientationLockDelegate->attach();
|
| +}
|
| +
|
| +void MediaControls::onRemovedFromDocument() {
|
| + // TODO(mlamouri): we hide show the controls instead of having
|
| + // HTMLMediaElement do it.
|
| +
|
| + m_windowEventListener->stop();
|
| + m_mediaEventListener->detach();
|
| + if (m_orientationLockDelegate)
|
| + m_orientationLockDelegate->detach();
|
| +}
|
| +
|
| void MediaControls::onVolumeChange() {
|
| m_muteButton->updateDisplayType();
|
| m_volumeSlider->setVolume(mediaElement().muted() ? 0
|
|
|