| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/remoteplayback/HTMLMediaElementRemotePlayback.h" | 5 #include "modules/remoteplayback/HTMLMediaElementRemotePlayback.h" |
| 6 | 6 |
| 7 #include "core/dom/DOMException.h" | 7 #include "core/dom/DOMException.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/dom/QualifiedName.h" | 9 #include "core/dom/QualifiedName.h" |
| 10 #include "core/html/HTMLMediaElement.h" | 10 #include "core/html/HTMLMediaElement.h" |
| 11 #include "modules/remoteplayback/RemotePlayback.h" | 11 #include "modules/remoteplayback/RemotePlayback.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 // static | 15 // static |
| 16 bool HTMLMediaElementRemotePlayback::FastHasAttribute( | 16 bool HTMLMediaElementRemotePlayback::FastHasAttribute( |
| 17 const QualifiedName& name, | 17 const QualifiedName& name, |
| 18 const HTMLMediaElement& element) { | 18 const HTMLMediaElement& element) { |
| 19 ASSERT(name == HTMLNames::disableremoteplaybackAttr); | 19 DCHECK(name == HTMLNames::disableremoteplaybackAttr); |
| 20 return element.FastHasAttribute(name); | 20 return element.FastHasAttribute(name); |
| 21 } | 21 } |
| 22 | 22 |
| 23 // static | 23 // static |
| 24 void HTMLMediaElementRemotePlayback::SetBooleanAttribute( | 24 void HTMLMediaElementRemotePlayback::SetBooleanAttribute( |
| 25 const QualifiedName& name, | 25 const QualifiedName& name, |
| 26 HTMLMediaElement& element, | 26 HTMLMediaElement& element, |
| 27 bool value) { | 27 bool value) { |
| 28 ASSERT(name == HTMLNames::disableremoteplaybackAttr); | 28 DCHECK(name == HTMLNames::disableremoteplaybackAttr); |
| 29 element.SetBooleanAttribute(name, value); | 29 element.SetBooleanAttribute(name, value); |
| 30 | 30 |
| 31 HTMLMediaElementRemotePlayback& self = | 31 HTMLMediaElementRemotePlayback& self = |
| 32 HTMLMediaElementRemotePlayback::From(element); | 32 HTMLMediaElementRemotePlayback::From(element); |
| 33 if (self.remote_ && value) | 33 if (self.remote_ && value) |
| 34 self.remote_->RemotePlaybackDisabled(); | 34 self.remote_->RemotePlaybackDisabled(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 // static | 37 // static |
| 38 HTMLMediaElementRemotePlayback& HTMLMediaElementRemotePlayback::From( | 38 HTMLMediaElementRemotePlayback& HTMLMediaElementRemotePlayback::From( |
| (...skipping 27 matching lines...) Expand all Loading... |
| 66 const char* HTMLMediaElementRemotePlayback::SupplementName() { | 66 const char* HTMLMediaElementRemotePlayback::SupplementName() { |
| 67 return "HTMLMediaElementRemotePlayback"; | 67 return "HTMLMediaElementRemotePlayback"; |
| 68 } | 68 } |
| 69 | 69 |
| 70 DEFINE_TRACE(HTMLMediaElementRemotePlayback) { | 70 DEFINE_TRACE(HTMLMediaElementRemotePlayback) { |
| 71 visitor->Trace(remote_); | 71 visitor->Trace(remote_); |
| 72 Supplement<HTMLMediaElement>::Trace(visitor); | 72 Supplement<HTMLMediaElement>::Trace(visitor); |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace blink | 75 } // namespace blink |
| OLD | NEW |