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

Unified Diff: src/platform/window_manager/window_manager.cc

Issue 1593003: Added mute key handling to the WM. Also removed ACPI hotkey handler (Closed)
Patch Set: Created 10 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 | « src/platform/acpi/event_hotkey ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/window_manager/window_manager.cc
diff --git a/src/platform/window_manager/window_manager.cc b/src/platform/window_manager/window_manager.cc
index 02d00e6edd53948d8deb8643b6a55cdc25d3d31c..ea52b52d25317733e20cd5316c6d0b50c4fd8635 100644
--- a/src/platform/window_manager/window_manager.cc
+++ b/src/platform/window_manager/window_manager.cc
@@ -53,6 +53,9 @@ DEFINE_string(wm_increase_volume_command,
DEFINE_string(wm_decrease_volume_command,
"/usr/bin/amixer -- sset Master unmute 5%-",
"Command to decrease audio volume");
+DEFINE_string(wm_mute_audio_command,
+ "/usr/bin/amixer -- sset Master mute",
+ "Command to mute audio");
DEFINE_string(wm_initial_chrome_window_mapped_file,
"", "When we first see a toplevel Chrome window get mapped, "
"we write its ID as an ASCII decimal number to this file. "
@@ -797,6 +800,14 @@ void WindowManager::RegisterKeyBindings() {
NULL, NULL);
key_bindings_->AddBinding(
KeyBindings::KeyCombo(XF86XK_AudioLowerVolume), "decrease-audio-volume");
+
+ key_bindings_->AddAction(
+ "mute-audio",
+ NewPermanentCallback(
+ this, &WindowManager::RunCommand, FLAGS_wm_mute_audio_command),
+ NULL, NULL);
+ key_bindings_->AddBinding(
+ KeyBindings::KeyCombo(XF86XK_AudioMute), "mute-audio");
}
bool WindowManager::ManageExistingWindows() {
« no previous file with comments | « src/platform/acpi/event_hotkey ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698