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

Unified Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 174018: Disable mute/unmute when media does not have an audio track. (Closed)
Patch Set: Merged Created 11 years, 4 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 | chrome/common/render_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/render_view_context_menu.cc
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 75d02c0a9b2d3b81583d753ed1239059b6f8688c..62cfdbc9663f6240912ff40573808de0b7718c2b 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -317,12 +317,17 @@ bool RenderViewContextMenu::IsItemCommandEnabled(int id) const {
// error state.
case IDS_CONTENT_CONTEXT_PLAY:
case IDS_CONTENT_CONTEXT_PAUSE:
- case IDS_CONTENT_CONTEXT_MUTE:
- case IDS_CONTENT_CONTEXT_UNMUTE:
case IDS_CONTENT_CONTEXT_LOOP:
return (params_.media_params.player_state &
ContextMenuMediaParams::IN_ERROR) == 0;
+ // Mute and unmute should also be disabled if the player has no audio.
+ case IDS_CONTENT_CONTEXT_MUTE:
+ case IDS_CONTENT_CONTEXT_UNMUTE:
+ return params_.media_params.has_audio &&
+ (params_.media_params.player_state &
+ ContextMenuMediaParams::IN_ERROR) == 0;
+
case IDS_CONTENT_CONTEXT_SAVESCREENSHOTAS:
// TODO(ajwong): Enable save screenshot after we actually implement
// this.
« no previous file with comments | « no previous file | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698