Index: third_party/WebKit/Source/core/html/HTMLMediaElementControlsList.cpp |
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElementControlsList.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElementControlsList.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c456fbe006d785922032f71be46ec2c285cc8c76 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElementControlsList.cpp |
@@ -0,0 +1,48 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "core/html/HTMLMediaElementControlsList.h" |
+ |
+#include "core/html/HTMLMediaElement.h" |
+ |
+namespace blink { |
+ |
+namespace { |
+ |
+const char* kSupportedTokens[] = {"nodownload", "nofullscreen", |
+ "noremoteplayback"}; |
+ |
+bool isTokenSupported(const AtomicString& token) { |
mlamouri (slow - plz ping)
2017/03/03 17:32:44
Why is this an anonymous method if it's used in on
whywhat
2017/03/07 12:59:45
Done.
|
+ for (const char* supportedToken : kSupportedTokens) { |
+ if (token == supportedToken) |
+ return true; |
+ } |
+ return false; |
+} |
+ |
+} // namespace |
+ |
+HTMLMediaElementControlsList::HTMLMediaElementControlsList( |
+ HTMLMediaElement* element) |
+ : DOMTokenList(this), m_element(element) {} |
+ |
+HTMLMediaElementControlsList::~HTMLMediaElementControlsList() {} |
mlamouri (slow - plz ping)
2017/03/03 17:32:44
= default;
whywhat
2017/03/07 12:59:46
Done.
|
+ |
+DEFINE_TRACE(HTMLMediaElementControlsList) { |
+ visitor->trace(m_element); |
+ DOMTokenList::trace(visitor); |
+ DOMTokenListObserver::trace(visitor); |
+} |
+ |
+bool HTMLMediaElementControlsList::validateTokenValue( |
+ const AtomicString& tokenValue, |
+ ExceptionState&) const { |
+ return isTokenSupported(tokenValue); |
+} |
+ |
+void HTMLMediaElementControlsList::valueWasSet() { |
+ m_element->controlsListValueWasSet(); |
+} |
+ |
+} // namespace blink |