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

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

Issue 2588823002: Media Controls: change how the MediaControls object is created and handled. (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/core/html/shadow/MediaControls.h ('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 cf9626ce0095e2ee396c6529efbffd17b481c6bd..ced56f07453ec37c31e5dd02ae6ca2925ef461f3 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
@@ -140,10 +140,12 @@ MediaControls::MediaControls(HTMLMediaElement& mediaElement)
m_panelWidth(0),
m_keepShowingUntilTimerFires(false) {}
-MediaControls* MediaControls::create(HTMLMediaElement& mediaElement) {
+MediaControls* MediaControls::create(HTMLMediaElement& mediaElement,
+ ShadowRoot& shadowRoot) {
MediaControls* controls = new MediaControls(mediaElement);
controls->setShadowPseudoId(AtomicString("-webkit-media-controls"));
controls->initializeControls();
+ controls->reset();
// Initialize the orientation lock when going fullscreen feature.
if (RuntimeEnabledFeatures::videoFullscreenOrientationLockEnabled() &&
@@ -153,6 +155,7 @@ MediaControls* MediaControls::create(HTMLMediaElement& mediaElement) {
toHTMLVideoElement(mediaElement));
}
+ shadowRoot.appendChild(controls);
return controls;
}
@@ -354,7 +357,6 @@ void MediaControls::reset() {
onTextTracksAddedOrRemoved();
m_fullscreenButton->setIsWanted(shouldShowFullscreenButton(mediaElement()));
- m_fullscreenButton->setIsFullscreen(mediaElement().isFullscreen());
Zhiqiang Zhang (Slow) 2016/12/20 12:16:46 nit: why move this to FullscreenButton::create() b
mlamouri (slow - plz ping) 2016/12/20 13:36:24 I moved this here in my previous CL. I realised it
refreshCastButtonVisibilityWithoutUpdate();
« no previous file with comments | « third_party/WebKit/Source/core/html/shadow/MediaControls.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698