| 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..21165e6603aa95b203457a7c43b9ec04203d8f6e 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,28 @@ void MediaControlElement::setDisplayType(MediaControlElementType displayType)
|
| object->setShouldDoFullPaintInvalidation();
|
| }
|
|
|
| +void MediaControlElement::shouldShowButtonInOverflowMenu(bool shouldShow)
|
| +{
|
| + if (!hasOverflowButton())
|
| + return;
|
| +
|
| + if (shouldShow)
|
| + m_overflowMenuElement->removeInlineStyleProperty(CSSPropertyDisplay);
|
| + else
|
| + m_overflowMenuElement->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone);
|
| +}
|
| +
|
| +String MediaControlElement::getOverflowString()
|
| +{
|
| + return mediaElement().locale().queryString(getOverflowStringName());
|
| +}
|
| +
|
| DEFINE_TRACE(MediaControlElement)
|
| {
|
| visitor->trace(m_mediaControls);
|
| visitor->trace(m_element);
|
| + visitor->trace(m_overflowMenuElement);
|
| + visitor->trace(m_overflowText);
|
| }
|
|
|
| // ----------------------------
|
| @@ -149,6 +170,31 @@ bool MediaControlInputElement::isMouseFocusable() const
|
| return false;
|
| }
|
|
|
| +HTMLElement* MediaControlInputElement::createOverflowElement(MediaControls& mediaControls, MediaControlInputElement* button)
|
| +{
|
| + if (!button)
|
| + return nullptr;
|
| + // We don't want the button visible within the overflow menu.
|
| + button->setIsWanted(false);
|
| +
|
| + m_overflowText = Text::create(mediaControls.document(), button->getOverflowString());
|
| +
|
| + HTMLLabelElement* element = HTMLLabelElement::create(mediaControls.document());
|
| + element->setShadowPseudoId(AtomicString("-internal-media-controls-overflow-menu-list-item"));
|
| + // Appending a button to a label element ensures that clicks on the label
|
| + // are passed down to the button, performing the action we'd expect.
|
| + element->appendChild(button);
|
| + element->appendChild(m_overflowText);
|
| + m_overflowMenuElement = element;
|
| + return element;
|
| +}
|
| +
|
| +void MediaControlInputElement::updateOverflowString()
|
| +{
|
| + if (m_overflowMenuElement && m_overflowText)
|
| + m_overflowText->replaceWholeText(getOverflowString());
|
| +}
|
| +
|
| DEFINE_TRACE(MediaControlInputElement)
|
| {
|
| MediaControlElement::trace(visitor);
|
|
|