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

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

Issue 1156993013: New media playback UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: actually got the other CL number right... Created 5 years, 5 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: Source/core/html/shadow/MediaControls.h
diff --git a/Source/core/html/shadow/MediaControls.h b/Source/core/html/shadow/MediaControls.h
index 0c8f7ad3b959a3755d7dca5e027373463508189b..19f7182baeed9406632226818f6be62b0578e146 100644
--- a/Source/core/html/shadow/MediaControls.h
+++ b/Source/core/html/shadow/MediaControls.h
@@ -67,6 +67,11 @@ public:
void stoppedCasting();
void refreshCastButtonVisibility();
void showOverlayCastButton();
+ // Update cast button visibility, but don't try to update our panel
+ // button visibility for space.
+ void refreshCastButtonVisibilityWithoutUpdate();
+
+ void setAllowHiddenVolumeControls(bool);
void mediaElementFocused();
@@ -74,9 +79,14 @@ public:
// used for overlap checking during text track layout. May be null.
LayoutObject* layoutObjectForTextTrackLayout();
+ // Notify us that our controls enclosure has changed width.
+ void notifyPanelWidthChanged(const LayoutUnit& newWidth);
+
DECLARE_VIRTUAL_TRACE();
private:
+ class BatchedControlUpdate;
+
explicit MediaControls(HTMLMediaElement&);
void initializeControls();
@@ -103,12 +113,25 @@ private:
// element in the page, it will be hidden.
void tryShowOverlayCastButton();
+ void panelWidthChangedTimerFired(Timer<MediaControls>*);
+
+ // Hide elements that don't fit, and show those things that we want which
+ // do fit. This requires that m_panelWidth is current.
+ void computeWhichControlsFit();
+
// Node
bool isMediaControls() const override { return true; }
bool willRespondToMouseMoveEvents() override { return true; }
void defaultEventHandler(Event*) override;
bool containsRelatedTarget(Event*);
+ // Open a new batch of controls updates.
+ void beginBatchUpdate();
+
+ // Close the innermost batch of controls updates. If this is the only
+ // open batch, then also update the control layout.
+ void endBatchUpdate();
+
RawPtrWillBeMember<HTMLMediaElement> m_mediaElement;
// Media control elements.
@@ -131,6 +154,14 @@ private:
unsigned m_hideTimerBehaviorFlags;
bool m_isMouseOverControls : 1;
bool m_isPausedForScrubbing : 1;
+
+ Timer<MediaControls> m_panelWidthChangedTimer;
+ int m_panelWidth;
+
+ bool m_allowHiddenVolumeControls : 1;
+ bool m_keepMuteButton : 1;
+
+ int m_batchDepth;
philipj_slow 2015/08/03 13:52:34 Rather than keeping the state on the MediaControls
philipj_slow 2015/08/04 11:54:53 Ping.
liberato (no reviews please) 2015/08/04 15:07:00 if two tabs have media controls, might they not ge
philipj_slow 2015/08/04 15:15:59 A grep for 'static unsigned s_' will find the patt
liberato (no reviews please) 2015/08/05 06:11:35 Done.
};
DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls());

Powered by Google App Engine
This is Rietveld 408576698