Chromium Code Reviews| Index: chrome/browser/chromeos/system_key_event_listener.cc |
| diff --git a/chrome/browser/chromeos/system_key_event_listener.cc b/chrome/browser/chromeos/system_key_event_listener.cc |
| index e2d90fd3efeff842e4158d86b2b93d1e37fbec68..8deddb5176d0a447a239d8738339c1c1f4741e8f 100644 |
| --- a/chrome/browser/chromeos/system_key_event_listener.cc |
| +++ b/chrome/browser/chromeos/system_key_event_listener.cc |
| @@ -8,10 +8,16 @@ |
| #include <X11/XF86keysym.h> |
| #include <X11/XKBlib.h> |
| +// Undefine "Status" macro defined by X header. |
| +#undef Status |
|
dmazzoni
2011/08/24 14:49:02
Why is this necessary? Why wasn't it necessary bef
yoshiki
2011/08/29 09:16:16
Defining "Status" was conflicted with "enum Status
|
| + |
| +#include "chrome/browser/accessibility_events.h" |
| #include "chrome/browser/chromeos/audio_handler.h" |
| #include "chrome/browser/chromeos/brightness_bubble.h" |
| #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
| #include "chrome/browser/chromeos/volume_bubble.h" |
| +#include "chrome/browser/profiles/profile_manager.h" |
| +#include "chrome/common/chrome_notification_types.h" |
| #include "content/browser/user_metrics.h" |
| #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" |
| @@ -174,6 +180,14 @@ void SystemKeyEventListener::OnVolumeMute() { |
| // Always muting (and not toggling) as per final decision on |
| // http://crosbug.com/3751 |
| audio_handler_->SetMuted(true); |
| + |
| + Profile *profile = ProfileManager::GetDefaultProfile(); |
|
Daniel Erat
2011/08/24 14:52:57
refactor this into a simple private method that ta
yoshiki
2011/08/29 09:16:16
Done.
|
| + AccessibilityVolumeInfo info(profile, |
| + audio_handler_->GetVolumePercent(), |
| + audio_handler_->IsMuted()); |
| + SendAccessibilityNotification(chrome::NOTIFICATION_ACCESSIBILITY_VOLUME_MUTE, |
| + &info); |
| + |
| ShowVolumeBubble(); |
| } |
| @@ -185,6 +199,14 @@ void SystemKeyEventListener::OnVolumeDown() { |
| audio_handler_->SetVolumePercent(0.0); |
| else |
| audio_handler_->AdjustVolumeByPercent(-kStepPercentage); |
| + |
| + Profile *profile = ProfileManager::GetDefaultProfile(); |
| + AccessibilityVolumeInfo info(profile, |
| + audio_handler_->GetVolumePercent(), |
| + audio_handler_->IsMuted()); |
| + SendAccessibilityNotification(chrome::NOTIFICATION_ACCESSIBILITY_VOLUME_DOWN, |
| + &info); |
| + |
| ShowVolumeBubble(); |
| } |
| @@ -199,6 +221,14 @@ void SystemKeyEventListener::OnVolumeUp() { |
| } else { |
| audio_handler_->AdjustVolumeByPercent(kStepPercentage); |
| } |
| + |
| + Profile *profile = ProfileManager::GetDefaultProfile(); |
| + AccessibilityVolumeInfo info(profile, |
| + audio_handler_->GetVolumePercent(), |
| + audio_handler_->IsMuted()); |
| + SendAccessibilityNotification(chrome::NOTIFICATION_ACCESSIBILITY_VOLUME_UP, |
| + &info); |
| + |
| ShowVolumeBubble(); |
| } |