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..87f20e148ec546e7fb5bb26515422861c421ac35 100644 |
| --- a/third_party/WebKit/Source/core/html/shadow/MediaControls.h |
| +++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.h |
| @@ -83,12 +83,12 @@ 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(); |
| + // Called by LayoutMedia. |
| + void onLayout(int width, int height); |
| + |
| void toggleOverflowMenu(); |
| bool overflowMenuVisible(); |
| @@ -128,6 +128,12 @@ class CORE_EXPORT MediaControls final : public HTMLDivElement { |
| class BatchedControlUpdate; |
| + // Notify us that our controls enclosure has changed size. |
| + void notifyElementSizeChanged(int newWidth, int newHeight); |
| + class MediaControlsResizeObserverCallback; |
|
whywhat
2017/02/23 21:37:32
nits:
- move the class declaration next to Batched
steimel
2017/02/24 00:42:44
Done.
|
| + Member<ResizeObserver> m_resizeObserver; |
| + bool m_sizingInitialized = false; |
| + |
| explicit MediaControls(HTMLMediaElement&); |
| void initializeControls(); |
| @@ -151,12 +157,12 @@ 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_elementWidth and m_elementHeight are current. |
| void computeWhichControlsFit(); |
| // Node |
| @@ -217,8 +223,9 @@ class CORE_EXPORT MediaControls final : public HTMLDivElement { |
| bool m_isMouseOverControls : 1; |
| bool m_isPausedForScrubbing : 1; |
| - TaskRunnerTimer<MediaControls> m_panelWidthChangedTimer; |
| - int m_panelWidth; |
| + TaskRunnerTimer<MediaControls> m_elementSizeChangedTimer; |
| + int m_elementWidth; |
| + int m_elementHeight; |
| bool m_keepShowingUntilTimerFires : 1; |
| }; |