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

Unified Diff: Source/web/ContextMenuClientImpl.cpp

Issue 200723010: Rename MediaHasVideo bit to MediaCanToggleControls. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Comment MediaCanToggleControls logic. Created 6 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
« no previous file with comments | « no previous file | public/web/WebContextMenuData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/ContextMenuClientImpl.cpp
diff --git a/Source/web/ContextMenuClientImpl.cpp b/Source/web/ContextMenuClientImpl.cpp
index 536d72cc8394da4ed3f34286fe866d8fb3246ffc..71b048c76d18b1fab65cadfd34ae8628f8363605 100644
--- a/Source/web/ContextMenuClientImpl.cpp
+++ b/Source/web/ContextMenuClientImpl.cpp
@@ -242,8 +242,12 @@ void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultM
data.mediaFlags |= WebContextMenuData::MediaCanSave;
if (mediaElement->hasAudio())
data.mediaFlags |= WebContextMenuData::MediaHasAudio;
- if (mediaElement->hasVideo())
- data.mediaFlags |= WebContextMenuData::MediaHasVideo;
+ // Media controls can be toggled only for video player. If we toggle
+ // controls for audio then the player disappears, and there is no way to
+ // return it back. Don't set this bit for fullscreen video, since
+ // toggling is ignored in that case.
+ if (mediaElement->hasVideo() && !mediaElement->isFullscreen())
+ data.mediaFlags |= WebContextMenuData::MediaCanToggleControls;
if (mediaElement->controls())
data.mediaFlags |= WebContextMenuData::MediaControls;
} else if (isHTMLObjectElement(*r.innerNonSharedNode()) || isHTMLEmbedElement(*r.innerNonSharedNode())) {
« no previous file with comments | « no previous file | public/web/WebContextMenuData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698