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/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/dom/QualifiedName.h" | 8 #include "core/dom/QualifiedName.h" |
9 #include "core/html/HTMLMediaElement.h" | 9 #include "core/html/HTMLMediaElement.h" |
10 #include "modules/remoteplayback/RemotePlayback.h" | 10 #include "modules/remoteplayback/RemotePlayback.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // static | 21 // static |
22 void HTMLMediaElementRemotePlayback::setBooleanAttribute(const QualifiedName& na
me, HTMLMediaElement& element, bool value) | 22 void HTMLMediaElementRemotePlayback::setBooleanAttribute(const QualifiedName& na
me, HTMLMediaElement& element, bool value) |
23 { | 23 { |
24 ASSERT(name == HTMLNames::disableremoteplaybackAttr); | 24 ASSERT(name == HTMLNames::disableremoteplaybackAttr); |
25 element.setBooleanAttribute(name, value); | 25 element.setBooleanAttribute(name, value); |
26 } | 26 } |
27 | 27 |
28 // static | 28 // static |
29 HTMLMediaElementRemotePlayback& HTMLMediaElementRemotePlayback::from(HTMLMediaEl
ement& element) | 29 HTMLMediaElementRemotePlayback& HTMLMediaElementRemotePlayback::from(HTMLMediaEl
ement& element) |
30 { | 30 { |
31 HTMLMediaElementRemotePlayback* supplement = static_cast<HTMLMediaElementRem
otePlayback*>(HeapSupplement<HTMLMediaElement>::from(element, supplementName()))
; | 31 HTMLMediaElementRemotePlayback* supplement = static_cast<HTMLMediaElementRem
otePlayback*>(Supplement<HTMLMediaElement>::from(element, supplementName())); |
32 if (!supplement) { | 32 if (!supplement) { |
33 supplement = new HTMLMediaElementRemotePlayback(); | 33 supplement = new HTMLMediaElementRemotePlayback(); |
34 provideTo(element, supplementName(), supplement); | 34 provideTo(element, supplementName(), supplement); |
35 } | 35 } |
36 return *supplement; | 36 return *supplement; |
37 } | 37 } |
38 | 38 |
39 // static | 39 // static |
40 RemotePlayback* HTMLMediaElementRemotePlayback::remote(HTMLMediaElement& element
) | 40 RemotePlayback* HTMLMediaElementRemotePlayback::remote(HTMLMediaElement& element
) |
41 { | 41 { |
(...skipping 10 matching lines...) Expand all Loading... |
52 | 52 |
53 // static | 53 // static |
54 const char* HTMLMediaElementRemotePlayback::supplementName() | 54 const char* HTMLMediaElementRemotePlayback::supplementName() |
55 { | 55 { |
56 return "HTMLMediaElementRemotePlayback"; | 56 return "HTMLMediaElementRemotePlayback"; |
57 } | 57 } |
58 | 58 |
59 DEFINE_TRACE(HTMLMediaElementRemotePlayback) | 59 DEFINE_TRACE(HTMLMediaElementRemotePlayback) |
60 { | 60 { |
61 visitor->trace(m_remote); | 61 visitor->trace(m_remote); |
62 HeapSupplement<HTMLMediaElement>::trace(visitor); | 62 Supplement<HTMLMediaElement>::trace(visitor); |
63 } | 63 } |
64 | 64 |
65 } // namespace blink | 65 } // namespace blink |
OLD | NEW |