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; |
}; |
// ---------------------------- |