summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-20 21:28:17 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-20 21:28:17 +0000
commitbdaa1b75f4585b79cf64788f4011e39b01bdfabf (patch)
treeae28f297eb34366fc62ec659bb2cc88ed0c9be8b /webkit/glue
parent527f0441b0a66b5d3032a58b1dcdae696268b177 (diff)
downloadchromium_src-bdaa1b75f4585b79cf64788f4011e39b01bdfabf.zip
chromium_src-bdaa1b75f4585b79cf64788f4011e39b01bdfabf.tar.gz
chromium_src-bdaa1b75f4585b79cf64788f4011e39b01bdfabf.tar.bz2
Disable mute/unmute when media does not have an audio track.
BUG=18970 TEST=test matrix videos ending in 0 should have mute context menu disabled Review URL: http://codereview.chromium.org/174018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23889 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/context_menu.h5
-rw-r--r--webkit/glue/context_menu_client_impl.cc2
2 files changed, 6 insertions, 1 deletions
diff --git a/webkit/glue/context_menu.h b/webkit/glue/context_menu.h
index bdeba6c..e4b556b 100644
--- a/webkit/glue/context_menu.h
+++ b/webkit/glue/context_menu.h
@@ -82,8 +82,11 @@ struct ContextMenuMediaParams {
// playing, muted, etc.
int32 player_state;
+ // Whether a playable audio track is present.
+ bool has_audio;
+
ContextMenuMediaParams()
- : player_state(NO_STATE) {
+ : player_state(NO_STATE), has_audio(false) {
}
};
diff --git a/webkit/glue/context_menu_client_impl.cc b/webkit/glue/context_menu_client_impl.cc
index b32b572..ca2dee8 100644
--- a/webkit/glue/context_menu_client_impl.cc
+++ b/webkit/glue/context_menu_client_impl.cc
@@ -207,6 +207,8 @@ WebCore::PlatformMenuDescription
if (media_element->supportsSave()) {
media_params.player_state |= ContextMenuMediaParams::CAN_SAVE;
}
+
+ media_params.has_audio = media_element->hasAudio();
}
// If it's not a link, an image, a media element, or an image/media link,