Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/shadow/MediaControlElementTypes.cpp |
| diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlElementTypes.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControlElementTypes.cpp |
| index 45baeee686422bc5e60875db56b63dcc492aa276..3f7443177350ec93bd627211aa13e02af42e6b93 100644 |
| --- a/third_party/WebKit/Source/core/html/shadow/MediaControlElementTypes.cpp |
| +++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElementTypes.cpp |
| @@ -33,9 +33,12 @@ |
| #include "core/CSSValueKeywords.h" |
| #include "core/HTMLNames.h" |
| #include "core/css/StylePropertySet.h" |
| +#include "core/dom/Text.h" |
| #include "core/events/MouseEvent.h" |
| +#include "core/html/HTMLLabelElement.h" |
| #include "core/html/HTMLMediaElement.h" |
| #include "core/html/shadow/MediaControls.h" |
| +#include "platform/text/PlatformLocale.h" |
| namespace blink { |
| @@ -116,10 +119,27 @@ void MediaControlElement::setDisplayType(MediaControlElementType displayType) |
| object->setShouldDoFullPaintInvalidation(); |
| } |
| +void MediaControlElement::shouldShowButtonInOverflowMenu(bool shouldShow) |
| +{ |
| + if (!hasOverflowButton()) |
| + return; |
| + |
| + if (shouldShow) |
|
kdsilva
2016/08/27 14:20:49
It's not clear to me what the best way is to chang
kdsilva
2016/08/29 14:33:15
Hmm, so I think a cleaner approach might be to do
liberato (no reviews please)
2016/08/29 17:38:38
i think that the inline style property is the way
kdsilva
2016/08/29 20:44:13
Done.
|
| + m_overflowMenuElement->setShadowPseudoId("-internal-media-controls-overflow-menu-list-item"); |
| + else |
| + m_overflowMenuElement->setShadowPseudoId("-internal-media-controls-overflow-menu-list-item-hidden"); |
| +} |
| + |
| +String MediaControlElement::getText() |
|
liberato (no reviews please)
2016/08/29 17:38:38
maybe getOverflowString?
kdsilva
2016/08/29 20:44:13
Done.
|
| +{ |
| + return mediaElement().locale().queryString(getOverflowStringName()); |
| +} |
| + |
| DEFINE_TRACE(MediaControlElement) |
| { |
| visitor->trace(m_mediaControls); |
| visitor->trace(m_element); |
| + visitor->trace(m_overflowMenuElement); |
| } |
| // ---------------------------- |
| @@ -149,6 +169,15 @@ bool MediaControlInputElement::isMouseFocusable() const |
| return false; |
| } |
| +HTMLLabelElement* MediaControlInputElement::createOverflowMenuElement(MediaControls& mediaControls, MediaControlInputElement* child) |
| +{ |
| + HTMLLabelElement* element = HTMLLabelElement::create(mediaControls.document()); |
| + element->setShadowPseudoId(AtomicString("-internal-media-controls-overflow-menu-list-item")); |
| + element->appendChild(child); |
| + element->appendChild(Text::create(mediaControls.document(), child->getText())); |
| + return element; |
| +} |
| + |
| DEFINE_TRACE(MediaControlInputElement) |
| { |
| MediaControlElement::trace(visitor); |