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

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: cleaned up volume / mute hiding logic. 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..49360b1e16907fa77fad73a4342489e67aa42d66 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 an only if we're wanted and we fit.
philipj_slow 2015/07/10 14:51:59 s/an/and/
liberato (no reviews please) 2015/07/10 15:32:19 done.
+ 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