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

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControlElements.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/MediaControlElements.h
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.h b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.h
index c9aa995280ae8e19d2a823355e5b4e0ec8ad926f..1aabf2f8c4df4ef63c5cc25c5b0389a2861d999b 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.h
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.h
@@ -31,6 +31,7 @@
#define MediaControlElements_h
#include "core/html/shadow/MediaControlElementTypes.h"
+#include <set>
namespace blink {
@@ -94,6 +95,8 @@ public:
bool willRespondToMouseClickEvents() override { return true; }
void updateDisplayType() override;
+ String getText() override;
+
private:
explicit MediaControlMuteButtonElement(MediaControls&);
@@ -140,6 +143,8 @@ public:
void updateDisplayType() override;
+ String getText() override;
+
private:
explicit MediaControlToggleClosedCaptionsButtonElement(MediaControls&);
@@ -173,6 +178,42 @@ private:
};
// ----------------------------
+// Represents the overflow menu which is displayed when the width of the media
+// player is small enough that at least two buttons are no longer visible.
+class MediaControlOverflowMenu final : public MediaControlInputElement {
liberato (no reviews please) 2016/08/24 16:44:22 might want to include "Button" in the class name.
kdsilva 2016/08/26 18:11:03 Done.
+public:
+ static MediaControlOverflowMenu* create(MediaControls&);
+
+ // The overflow button should respond to mouse clicks since we want a click
+ // to open up the menu.
+ bool willRespondToMouseClickEvents() override { return true; }
+
+private:
+ explicit MediaControlOverflowMenu(MediaControls&);
+
+ void defaultEventHandler(Event*) override;
+};
+
+// ----------------------------
+// Holds a list of elements within the overflow menu.
+class MediaControlOverflowMenuListElement final : public MediaControlDivElement {
+public:
+ static MediaControlOverflowMenuListElement* create(MediaControls&);
+
+ // A set of the MediaControlElementTypes that should appear in the
+ // overflow menu.
+ void setOverflowMenuControls(const std::set<MediaControlElementType>*);
+
+ // True to display overflow menu, false to hide.
+ void showOverflowMenu(bool);
+
+private:
+ explicit MediaControlOverflowMenuListElement(MediaControls&);
+
+ void defaultEventHandler(Event*) override;
+};
+
+// ----------------------------
class MediaControlTimelineElement final : public MediaControlInputElement {
public:
@@ -184,7 +225,6 @@ public:
// is supported by HTMLMediaElement, see https://crbug.com/137275
void setPosition(double);
void setDuration(double);
-
private:
explicit MediaControlTimelineElement(MediaControls&);
@@ -202,6 +242,8 @@ public:
void setIsFullscreen(bool);
+ String getText() override;
+
private:
explicit MediaControlFullscreenButtonElement(MediaControls&);
@@ -218,6 +260,8 @@ public:
void setIsPlayingRemotely(bool);
+ String getText() override;
+
// This will show a cast button if it is not covered by another element.
// This MUST be called for cast button elements that are overlay elements.
void tryShowOverlay();

Powered by Google App Engine
This is Rietveld 408576698