Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/shadow/MediaControlElementTypes.h |
| diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlElementTypes.h b/third_party/WebKit/Source/core/html/shadow/MediaControlElementTypes.h |
| index cabfb86e924f2d3dcca320a6ce64e7e978cad6fb..eff0dddf71bc870388ca50a933e7128553503a96 100644 |
| --- a/third_party/WebKit/Source/core/html/shadow/MediaControlElementTypes.h |
| +++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElementTypes.h |
| @@ -34,6 +34,7 @@ |
| #include "core/html/HTMLDivElement.h" |
| #include "core/html/HTMLInputElement.h" |
| #include "core/layout/LayoutBlock.h" |
| +#include "public/platform/WebLocalizedString.h" |
| namespace blink { |
| @@ -67,6 +68,8 @@ enum MediaControlElementType { |
| MediaCastOnButton, |
| MediaOverlayCastOffButton, |
| MediaOverlayCastOnButton, |
| + MediaOverflowButton, |
| + MediaOverflowList, |
| }; |
| CORE_EXPORT const HTMLMediaElement* toParentMediaElement(const Node*); |
| @@ -89,6 +92,18 @@ public: |
| MediaControlElementType displayType() const { return m_displayType; } |
| + // By default, media controls elements are not added to the overflow menu. |
| + // Controls that can be added to the overflow menu should override this |
| + // function and return true. |
| + virtual bool hasOverflowButton() { return false; } |
| + |
| + // If true, shows the overflow menu item if it exists. Hides it if false. |
| + void shouldShowButtonInOverflowMenu(bool); |
| + |
| + // Returns a string representation of the media control element. Used for |
| + // the overflow menu. |
| + String getOverflowString(); |
|
mlamouri (slow - plz ping)
2016/09/01 18:29:15
`getOverflowMenuString()` or `getOverflowMenuLabel
kdsilva
2016/09/05 14:39:35
Done.
|
| + |
| DECLARE_VIRTUAL_TRACE(); |
| protected: |
| @@ -103,11 +118,28 @@ protected: |
| void setDisplayType(MediaControlElementType); |
| + // Represents the overflow menu element for this media control. |
| + // The Element contains the button that the user can click on, but having |
| + // the button within an Element enables us to style the overflow menu. |
| + // Setting this pointer is optional so it may be null. |
| + Member<Element> m_overflowMenuElement; |
| + |
| + Member<Text> m_overflowText; |
|
mlamouri (slow - plz ping)
2016/09/01 18:29:15
Should this be named `m_overflowMenuText`?
kdsilva
2016/09/05 14:39:35
Done.
|
| + |
| private: |
| // Hide or show based on our fits / wanted state. We want to show |
| // if and only if we're wanted and we fit. |
| void updateShownState(); |
| + // Returns a string representation of the media control element. |
| + // Subclasses should override this method to return the string representation |
| + // of the overflow button. |
| + virtual WebLocalizedString::Name getOverflowStringName() |
| + { |
| + NOTREACHED(); |
| + return WebLocalizedString::AXAMPMFieldText; |
| + } |
| + |
| Member<MediaControls> m_mediaControls; |
| MediaControlElementType m_displayType; |
| Member<HTMLElement> m_element; |
| @@ -136,6 +168,12 @@ class MediaControlInputElement : public HTMLInputElement, public MediaControlEle |
| public: |
| DECLARE_VIRTUAL_TRACE(); |
| + // Creates an overflow menu element with the given button as a child. |
| + HTMLElement* createOverflowElement(MediaControls&, MediaControlInputElement*); |
| + |
| + // Updates the value of the Text string shown in the overflow menu. |
| + void updateOverflowString(); |
|
liberato (no reviews please)
2016/09/01 18:05:19
might fit better in MediaControlElement, since tha
kdsilva
2016/09/05 14:39:35
Done.
|
| + |
| protected: |
| MediaControlInputElement(MediaControls&, MediaControlElementType); |
| @@ -143,6 +181,9 @@ private: |
| virtual void updateDisplayType() { } |
| bool isMediaControlElement() const final { return true; } |
| bool isMouseFocusable() const override; |
| + |
| + // Creates an overflow menu HTML element. |
| + virtual MediaControlInputElement* createOverflowButton(MediaControls&) { return nullptr; } |
| }; |
| // ---------------------------- |