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

Side by Side Diff: third_party/WebKit/Source/modules/media_controls/elements/MediaControlButtonPromoElements.cpp

Issue 2898543002: media_controls: Add UI for showing a promo bubble on a control button. (Closed)
Patch Set: .. Created 3 years, 7 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698