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

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

Issue 2873493004: [Media Controls] Prevent flicker when enter/exit fullscreen (Closed)
Patch Set: Add virtual/new-remote-playback-pipeline variants to SlowTests Created 3 years, 7 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 7bc6352bbc12a346c8795bbd5dd7cc055a514be4..2f32c0510fc28434d2ae7adb85c8c19b4a0dfffc 100644
--- a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp
+++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp
@@ -572,12 +572,14 @@ LayoutObject* MediaControlsImpl::ContainerLayoutObject() {
return GetLayoutObject();
}
-void MediaControlsImpl::Show() {
- MakeOpaque();
+void MediaControlsImpl::MaybeShow() {
panel_->SetIsWanted(true);
panel_->SetIsDisplayed(true);
if (overlay_play_button_)
overlay_play_button_->UpdateDisplayType();
+ // Only make the controls visible if they won't get hidden by OnTimeUpdate.
+ if (MediaElement().paused() || !ShouldHideMediaControls())
+ MakeOpaque();
}
void MediaControlsImpl::Hide() {
@@ -911,8 +913,8 @@ void MediaControlsImpl::OnFocusIn() {
if (!MediaElement().ShouldShowControls())
return;
- Show();
ResetHideMediaControlsTimer();
+ MaybeShow();
}
void MediaControlsImpl::OnTimeUpdate() {

Powered by Google App Engine
This is Rietveld 408576698