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

Side by Side 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, 8 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 unified diff | Download patch
« no previous file with comments | « src/platform/acpi/event_hotkey ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "window_manager/window_manager.h" 5 #include "window_manager/window_manager.h"
6 6
7 #include <cerrno> 7 #include <cerrno>
8 #include <cstdio> 8 #include <cstdio>
9 #include <cstdlib> 9 #include <cstdlib>
10 #include <cstring> 10 #include <cstring>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 "/usr/bin/screenshot", 46 "/usr/bin/screenshot",
47 "Path to the screenshot binary"); 47 "Path to the screenshot binary");
48 DEFINE_string(wm_screenshot_output_dir, 48 DEFINE_string(wm_screenshot_output_dir,
49 ".", "Output directory for screenshots"); 49 ".", "Output directory for screenshots");
50 DEFINE_string(wm_increase_volume_command, 50 DEFINE_string(wm_increase_volume_command,
51 "/usr/bin/amixer -- sset Master unmute 5%+", 51 "/usr/bin/amixer -- sset Master unmute 5%+",
52 "Command to increase audio volume"); 52 "Command to increase audio volume");
53 DEFINE_string(wm_decrease_volume_command, 53 DEFINE_string(wm_decrease_volume_command,
54 "/usr/bin/amixer -- sset Master unmute 5%-", 54 "/usr/bin/amixer -- sset Master unmute 5%-",
55 "Command to decrease audio volume"); 55 "Command to decrease audio volume");
56 DEFINE_string(wm_mute_audio_command,
57 "/usr/bin/amixer -- sset Master mute",
58 "Command to mute audio");
56 DEFINE_string(wm_initial_chrome_window_mapped_file, 59 DEFINE_string(wm_initial_chrome_window_mapped_file,
57 "", "When we first see a toplevel Chrome window get mapped, " 60 "", "When we first see a toplevel Chrome window get mapped, "
58 "we write its ID as an ASCII decimal number to this file. " 61 "we write its ID as an ASCII decimal number to this file. "
59 "Tests can watch for the file to know when the user is fully " 62 "Tests can watch for the file to know when the user is fully "
60 "logged in. Leave empty to disable."); 63 "logged in. Leave empty to disable.");
61 64
62 DEFINE_bool(wm_use_compositing, true, "Use compositing"); 65 DEFINE_bool(wm_use_compositing, true, "Use compositing");
63 66
64 using std::list; 67 using std::list;
65 using std::make_pair; 68 using std::make_pair;
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 key_bindings_->AddBinding( 793 key_bindings_->AddBinding(
791 KeyBindings::KeyCombo(XF86XK_AudioRaiseVolume), "increase-audio-volume"); 794 KeyBindings::KeyCombo(XF86XK_AudioRaiseVolume), "increase-audio-volume");
792 795
793 key_bindings_->AddAction( 796 key_bindings_->AddAction(
794 "decrease-audio-volume", 797 "decrease-audio-volume",
795 NewPermanentCallback( 798 NewPermanentCallback(
796 this, &WindowManager::RunCommand, FLAGS_wm_decrease_volume_command), 799 this, &WindowManager::RunCommand, FLAGS_wm_decrease_volume_command),
797 NULL, NULL); 800 NULL, NULL);
798 key_bindings_->AddBinding( 801 key_bindings_->AddBinding(
799 KeyBindings::KeyCombo(XF86XK_AudioLowerVolume), "decrease-audio-volume"); 802 KeyBindings::KeyCombo(XF86XK_AudioLowerVolume), "decrease-audio-volume");
803
804 key_bindings_->AddAction(
805 "mute-audio",
806 NewPermanentCallback(
807 this, &WindowManager::RunCommand, FLAGS_wm_mute_audio_command),
808 NULL, NULL);
809 key_bindings_->AddBinding(
810 KeyBindings::KeyCombo(XF86XK_AudioMute), "mute-audio");
800 } 811 }
801 812
802 bool WindowManager::ManageExistingWindows() { 813 bool WindowManager::ManageExistingWindows() {
803 vector<XWindow> windows; 814 vector<XWindow> windows;
804 if (!xconn_->GetChildWindows(root_, &windows)) { 815 if (!xconn_->GetChildWindows(root_, &windows)) {
805 return false; 816 return false;
806 } 817 }
807 818
808 // Panel content windows that are already mapped. We defer calling 819 // Panel content windows that are already mapped. We defer calling
809 // HandleMappedWindow() on these until we've handled all other windows to 820 // HandleMappedWindow() on these until we've handled all other windows to
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
1652 // TODO: Display the message onscreen. 1663 // TODO: Display the message onscreen.
1653 } 1664 }
1654 1665
1655 void WindowManager::QueryKeyboardState() { 1666 void WindowManager::QueryKeyboardState() {
1656 vector<uint8_t> keycodes; 1667 vector<uint8_t> keycodes;
1657 xconn_->QueryKeyboardState(&keycodes); 1668 xconn_->QueryKeyboardState(&keycodes);
1658 hotkey_overlay_->HandleKeyboardState(keycodes); 1669 hotkey_overlay_->HandleKeyboardState(keycodes);
1659 } 1670 }
1660 1671
1661 } // namespace window_manager 1672 } // namespace window_manager
OLDNEW
« 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