Chromium Code Reviews| 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; |
| }; |
| // ---------------------------- |