Chromium Code Reviews| 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 74805310d50a486754080001c24d9494b9eecfb0..b21939ff054e53b475d80d8fc21bbdbbd5448270 100644 |
| --- a/third_party/WebKit/Source/core/html/shadow/MediaControls.h |
| +++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.h |
| @@ -83,9 +83,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(); |
| @@ -126,7 +123,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&); |
| @@ -151,12 +153,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 |
| @@ -217,8 +220,13 @@ 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; |
|
atotic
2017/03/01 20:27:35
I am not an Oilpan expert, but I think we might ha
|
| + |
| + TaskRunnerTimer<MediaControls> m_elementSizeChangedTimer; |
| + int m_effectiveWidth; |
| + int m_effectiveHeight; |
|
mlamouri (slow - plz ping)
2017/02/28 16:03:14
I still think that `IntSize m_size;` would actuall
steimel
2017/03/01 15:58:31
Done.
|
| bool m_keepShowingUntilTimerFires : 1; |
| }; |