Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControls.h

Issue 2701433003: Hide overlay play button if it can't be shown without clipping (Closed)
Patch Set: Add comments for dependent constants Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
};

Powered by Google App Engine
This is Rietveld 408576698