| 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..8e8199946bd84aa79ec8bdcc9c95c0b62966db93 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();
|
| @@ -126,7 +126,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(int newWidth, int newHeight);
|
|
|
| explicit MediaControls(HTMLMediaElement&);
|
|
|
| @@ -151,12 +156,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 +223,18 @@ 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;
|
| +
|
| + // Indicates whether |m_effectiveWidth|/|m_effectiveHeight| have been set via
|
| + // notifyElementSizeChanged yet. Used to decide whether or not to do so on a
|
| + // layout.
|
| + bool m_sizingInitialized : 1;
|
| +
|
| + TaskRunnerTimer<MediaControls> m_elementSizeChangedTimer;
|
| + int m_effectiveWidth;
|
| + int m_effectiveHeight;
|
|
|
| bool m_keepShowingUntilTimerFires : 1;
|
| };
|
|
|