Index: third_party/WebKit/Source/core/html/shadow/MediaControls.h |
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControls.h b/third_party/WebKit/Source/core/html/shadow/MediaControls.h |
index 5ced7c1bb568479c6d9a85fa667a07c99240e780..6698f446d40c3c43c105d6f0c4a88871a48a57b0 100644 |
--- a/third_party/WebKit/Source/core/html/shadow/MediaControls.h |
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.h |
@@ -87,9 +87,6 @@ class CORE_EXPORT MediaControls final : public HTMLDivElement { |
return m_volumeSlider; |
} |
- // Notify us that our controls enclosure has changed width. |
- void notifyPanelWidthChanged(const LayoutUnit& newWidth); |
- |
// Notify us that the media element's network state has changed. |
void networkStateChanged(); |
@@ -130,7 +127,12 @@ class CORE_EXPORT MediaControls final : public HTMLDivElement { |
void invalidate(Element*); |
+ // Need to be members of MediaControls for private member access. |
class BatchedControlUpdate; |
+ class MediaControlsResizeObserverCallback; |
+ |
+ // Notify us that our controls enclosure has changed size. |
+ void notifyElementSizeChanged(ClientRect* newSize); |
explicit MediaControls(HTMLMediaElement&); |
@@ -155,12 +157,13 @@ class CORE_EXPORT MediaControls final : public HTMLDivElement { |
void stopHideMediaControlsTimer(); |
void resetHideMediaControlsTimer(); |
- void panelWidthChangedTimerFired(TimerBase*); |
+ void elementSizeChangedTimerFired(TimerBase*); |
void hideAllMenus(); |
// Hide elements that don't fit, and show those things that we want which |
- // do fit. This requires that m_panelWidth is current. |
+ // do fit. This requires that m_effectiveWidth and m_effectiveHeight are |
+ // current. |
void computeWhichControlsFit(); |
// Node |
@@ -221,8 +224,12 @@ class CORE_EXPORT MediaControls final : public HTMLDivElement { |
bool m_isMouseOverControls : 1; |
bool m_isPausedForScrubbing : 1; |
- TaskRunnerTimer<MediaControls> m_panelWidthChangedTimer; |
- int m_panelWidth; |
+ // Watches the video element for resize and updates media controls as |
+ // necessary. |
+ Member<ResizeObserver> m_resizeObserver; |
+ |
+ TaskRunnerTimer<MediaControls> m_elementSizeChangedTimer; |
+ IntSize m_size; |
bool m_keepShowingUntilTimerFires : 1; |
}; |