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

Unified Diff: third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp

Issue 2943983003: chrome/blink: Add functionality for in-product help for media elements. (Closed)
Patch Set: not on pause. Created 3 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: third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp
diff --git a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp
index 9bf2b7bd75b07965ea592663da13bd45c8245d39..efea1136a290526aa469d60c0472eec64299b73f 100644
--- a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp
+++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp
@@ -581,6 +581,7 @@ void MediaControlsImpl::MaybeShow() {
// Only make the controls visible if they won't get hidden by OnTimeUpdate.
if (MediaElement().paused() || !ShouldHideMediaControls())
MakeOpaque();
+ download_button_->UpdateInProductHelpState();
mlamouri (slow - plz ping) 2017/07/13 21:14:27 `MakeOpaque()` is what you care about here. I'm af
Khushal 2017/07/17 17:52:20 So I think I wasn't understanding the 2 states on
}
void MediaControlsImpl::Hide() {
@@ -588,6 +589,7 @@ void MediaControlsImpl::Hide() {
panel_->SetIsDisplayed(false);
if (overlay_play_button_)
overlay_play_button_->SetIsWanted(false);
+ download_button_->UpdateInProductHelpState();
}
bool MediaControlsImpl::IsVisible() const {
@@ -643,6 +645,10 @@ bool MediaControlsImpl::ShouldHideMediaControls(unsigned behavior_flags) const {
if (text_track_list_->IsWanted() || overflow_list_->IsWanted())
return false;
+ // Don't hide the media controls while the in product help is showing.
+ if (download_button_->IsShowingInProductHelp())
+ return false;
+
return true;
}
@@ -971,6 +977,7 @@ void MediaControlsImpl::OnPlay() {
UpdatePlayState();
timeline_->SetPosition(MediaElement().currentTime());
UpdateCurrentTimeDisplay();
+ download_button_->MaybeDispatchInProductHelpTrigger();
}
void MediaControlsImpl::OnPlaying() {
@@ -1216,6 +1223,11 @@ void MediaControlsImpl::HideAllMenus() {
text_track_list_->SetVisible(false);
}
+void MediaControlsImpl::HideControlsIfNecessary() {
+ if (ShouldHideMediaControls())
+ StartHideMediaControlsTimer();
mlamouri (slow - plz ping) 2017/07/13 21:14:27 There is at least one other place with this logic.
Khushal 2017/07/17 17:52:20 Done.
+}
+
DEFINE_TRACE(MediaControlsImpl) {
visitor->Trace(element_mutation_callback_);
visitor->Trace(resize_observer_);

Powered by Google App Engine
This is Rietveld 408576698