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

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControlElementTypes.h

Issue 2243473002: Adding overflow menu to media player (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
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..ba750b6db6bad09481f028f618a2ecbce615b6ee 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 {
@@ -89,6 +90,25 @@ 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);
+
+ // Creates an overflow menu HTML element.
+ virtual Element* initOverflowButton(MediaControls&) { return nullptr; }
+
+ // Returns a string representation of the media control element. Used for
+ // the overflow menu.
+ String getText();
+
+ // Returns a string representation of the media control element.
+ // TODO: default value should be changed
+ virtual WebLocalizedString::Name getOverflowStringName() { return WebLocalizedString::AXAMPMFieldText; }
+
DECLARE_VIRTUAL_TRACE();
protected:
@@ -103,6 +123,11 @@ 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.
+ Member<Element> m_overflowMenuElement;
+
private:
// Hide or show based on our fits / wanted state. We want to show
// if and only if we're wanted and we fit.
@@ -136,6 +161,9 @@ class MediaControlInputElement : public HTMLInputElement, public MediaControlEle
public:
DECLARE_VIRTUAL_TRACE();
+ // Creates an overflow menu element with the given button as a child.
+ HTMLLabelElement* createOverflowMenuElement(MediaControls&, MediaControlInputElement*);
+
protected:
MediaControlInputElement(MediaControls&, MediaControlElementType);

Powered by Google App Engine
This is Rietveld 408576698