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

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 2657723002: [Blink, Media] Added controlsList to HTMLMediaElement (Closed)
Patch Set: Added a link to the spec. Created 3 years, 9 months 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/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index d5100e4ec98155eedbc7705d84514c9781249a29..12bdeea91444eca4108add71383687c328564f5f 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -464,7 +464,8 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName,
m_autoplayUmaHelper(AutoplayUmaHelper::create(this)),
m_remotePlaybackClient(nullptr),
m_autoplayVisibilityObserver(nullptr),
- m_mediaControls(nullptr) {
+ m_mediaControls(nullptr),
+ m_controlsList(HTMLMediaElementControlsList::create(this)) {
BLINK_MEDIA_LOG << "HTMLMediaElement(" << (void*)this << ")";
m_lockedPendingUserGesture = computeLockedPendingUserGesture(document);
@@ -598,6 +599,14 @@ void HTMLMediaElement::parseAttribute(
UseCounter::count(document(),
UseCounter::HTMLMediaElementControlsAttribute);
updateControlsVisibility();
+ } else if (name == controlslistAttr) {
+ UseCounter::count(document(),
+ UseCounter::HTMLMediaElementControlsListAttribute);
+ if (params.oldValue != params.newValue) {
+ m_controlsList->setValue(params.newValue);
+ if (mediaControls())
+ mediaControls()->onControlsListUpdated();
+ }
} else if (name == preloadAttr) {
setPlayerPreload();
} else if (name == disableremoteplaybackAttr) {
@@ -2437,6 +2446,19 @@ bool HTMLMediaElement::shouldShowControls(
return false;
}
+HTMLMediaElementControlsList* HTMLMediaElement::controlsList() const {
+ return m_controlsList.get();
+}
+
+void HTMLMediaElement::controlsListValueWasSet() {
+ if (fastGetAttribute(controlslistAttr) == m_controlsList->value())
+ return;
+
+ setSynchronizedLazyAttribute(controlslistAttr, m_controlsList->value());
+ if (mediaControls())
+ mediaControls()->onControlsListUpdated();
+}
+
double HTMLMediaElement::volume() const {
return m_volume;
}
@@ -3823,6 +3845,7 @@ DEFINE_TRACE(HTMLMediaElement) {
visitor->trace(m_srcObject);
visitor->trace(m_autoplayVisibilityObserver);
visitor->trace(m_mediaControls);
+ visitor->trace(m_controlsList);
visitor->template registerWeakMembers<HTMLMediaElement,
&HTMLMediaElement::clearWeakMembers>(
this);
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.h ('k') | third_party/WebKit/Source/core/html/HTMLMediaElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698