| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "modules/media_controls/elements/MediaControlButtonPromoElements.h" |
| 6 |
| 7 #include "modules/media_controls/MediaControlsImpl.h" |
| 8 #include "platform/text/PlatformLocale.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 MediaControlButtonPromoAnimation::MediaControlButtonPromoAnimation( |
| 13 MediaControlsImpl& controls) |
| 14 : MediaControlDivElement(controls, kMediaButtonPromoAnimation) { |
| 15 SetShadowPseudoId(AtomicString("-internal-media-controls-promo-animation")); |
| 16 } |
| 17 |
| 18 MediaControlButtonPromoArrow::MediaControlButtonPromoArrow( |
| 19 MediaControlsImpl& controls) |
| 20 : MediaControlDivElement(controls, kMediaButtonPromoArrow) { |
| 21 SetShadowPseudoId(AtomicString("-internal-media-controls-promo-arrow")); |
| 22 } |
| 23 |
| 24 MediaControlButtonPromoText::MediaControlButtonPromoText( |
| 25 MediaControlsImpl& controls, |
| 26 MediaControlElementType type, |
| 27 WebLocalizedString::Name name) |
| 28 : MediaControlDivElement(controls, type) { |
| 29 SetShadowPseudoId(AtomicString("-internal-media-controls-promo-text")); |
| 30 setTextContent(GetDocument() |
| 31 .GetCachedLocale(GetDocument().ContentLanguage()) |
| 32 .QueryString(name)); |
| 33 } |
| 34 |
| 35 MediaControlButtonPromoContainer::MediaControlButtonPromoContainer( |
| 36 MediaControlsImpl& controls, |
| 37 MediaControlElementType button_type, |
| 38 WebLocalizedString::Name promo_text) |
| 39 : MediaControlDivElement(controls, kMediaButtonPromoContainer) { |
| 40 SetShadowPseudoId(AtomicString("-internal-media-controls-promo-container")); |
| 41 |
| 42 animation_ = new MediaControlButtonPromoAnimation(controls); |
| 43 AppendChild(animation_); |
| 44 arrow_ = new MediaControlButtonPromoArrow(controls); |
| 45 AppendChild(arrow_); |
| 46 text_ = new MediaControlButtonPromoText(controls, button_type, promo_text); |
| 47 AppendChild(text_); |
| 48 } |
| 49 |
| 50 DEFINE_TRACE(MediaControlButtonPromoContainer) { |
| 51 visitor->Trace(animation_); |
| 52 visitor->Trace(arrow_); |
| 53 visitor->Trace(text_); |
| 54 MediaControlDivElement::Trace(visitor); |
| 55 } |
| 56 |
| 57 } // namespace blink |
| OLD | NEW |