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

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

Issue 1156993013: New media playback UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: minor decrufting. Created 5 years, 5 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: Source/core/html/shadow/MediaControlElementTypes.h
diff --git a/Source/core/html/shadow/MediaControlElementTypes.h b/Source/core/html/shadow/MediaControlElementTypes.h
index 09ad25fe82421f4fb91c91483cb4f623a241aef4..ab4c10ed937f8cbdbd8e46c6f8abbb0ff6baea26 100644
--- a/Source/core/html/shadow/MediaControlElementTypes.h
+++ b/Source/core/html/shadow/MediaControlElementTypes.h
@@ -76,8 +76,19 @@ CORE_EXPORT MediaControlElementType mediaControlElementType(Node*);
class MediaControlElement : public WillBeGarbageCollectedMixin {
public:
- void hide();
- void show();
+ // These hold the state about whether this control should be shown if
+ // space permits. These will also show / hide as needed.
+ void setIsWanted(bool);
+ bool isWanted();
+
+ // Tell us whether we fit or not. This will hide / show the control as
+ // needed, also.
+ void setDoesFit(bool);
+
+ // This returns the minimum width in pixels that we need to show
+ // this control. Ideally, this would just be shorthand for the computed
+ // style, but this must also work when the control is hidden.
+ int minimumWidth();
MediaControlElementType displayType() { return m_displayType; }
@@ -92,9 +103,15 @@ protected:
void setDisplayType(MediaControlElementType);
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();
+
MediaControls& m_mediaControls;
MediaControlElementType m_displayType;
RawPtrWillBeMember<HTMLElement> m_element;
+ bool m_isWanted : 1;
+ bool m_doesFit : 1;
};
// ----------------------------

Powered by Google App Engine
This is Rietveld 408576698