Index: Source/core/html/shadow/MediaControlElementTypes.cpp |
diff --git a/Source/core/html/shadow/MediaControlElementTypes.cpp b/Source/core/html/shadow/MediaControlElementTypes.cpp |
index 70d738556f731e1bee57b58bf0f4ca9d2a611bc1..1e42a826408b4daaf356898c3d3922cfeec9fb76 100644 |
--- a/Source/core/html/shadow/MediaControlElementTypes.cpp |
+++ b/Source/core/html/shadow/MediaControlElementTypes.cpp |
@@ -71,6 +71,8 @@ MediaControlElement::MediaControlElement(MediaControls& mediaControls, MediaCont |
: m_mediaControls(mediaControls) |
, m_displayType(displayType) |
, m_element(element) |
+ , m_isShown(true) |
+ , m_isWanted(true) |
{ |
} |
@@ -82,11 +84,48 @@ HTMLMediaElement& MediaControlElement::mediaElement() const |
void MediaControlElement::hide() |
{ |
m_element->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone); |
+ m_isShown = false; |
} |
void MediaControlElement::show() |
{ |
m_element->removeInlineStyleProperty(CSSPropertyDisplay); |
+ m_isShown = true; |
+} |
+ |
+bool MediaControlElement::isShown() |
+{ |
+ return m_isShown; |
+} |
+ |
+void MediaControlElement::want() |
+{ |
+ m_isWanted = true; |
+ show(); |
+} |
+ |
+void MediaControlElement::dontWant() |
+{ |
+ m_isWanted = false; |
+ hide(); |
+} |
+ |
+bool MediaControlElement::isWanted() |
+{ |
+ return m_isWanted; |
+} |
+ |
+int MediaControlElement::minimumWidth() |
+{ |
+ int minWidthInPixels = 48; |
philipj_slow
2015/07/08 15:06:38
Not sure the local variable explains much in such
liberato (no reviews please)
2015/07/09 12:10:56
Done.
|
+ |
+ // We could check the computed style here, but that depends on whether |
+ // we've been shown. Instead, we just memorize 48 except for the |
philipj_slow
2015/07/08 15:06:38
Not sure what "memorize" means here, maybe "assume
liberato (no reviews please)
2015/07/09 12:10:56
Done.
|
+ // timeline bar. |
+ if (m_displayType == MediaSlider) |
+ minWidthInPixels = 55; |
+ |
+ return minWidthInPixels; |
} |
void MediaControlElement::setDisplayType(MediaControlElementType displayType) |