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

Unified Diff: chrome/browser/chromeos/system_key_event_listener.cc

Issue 7708025: Adds extension APIs of events on changing volume. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix (to be commited) Created 9 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
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..99b72031b12bb2a15cba67a797ad8d90ace88426 100644
--- a/chrome/browser/chromeos/system_key_event_listener.cc
+++ b/chrome/browser/chromeos/system_key_event_listener.cc
@@ -8,6 +8,7 @@
#include <X11/XF86keysym.h>
#include <X11/XKBlib.h>
+#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"
@@ -174,6 +175,11 @@ void SystemKeyEventListener::OnVolumeMute() {
// Always muting (and not toggling) as per final decision on
// http://crosbug.com/3751
audio_handler_->SetMuted(true);
+
+ SendAccessibilityVolumeNotification(
+ audio_handler_->GetVolumePercent(),
+ audio_handler_->IsMuted());
+
ShowVolumeBubble();
}
@@ -185,6 +191,11 @@ void SystemKeyEventListener::OnVolumeDown() {
audio_handler_->SetVolumePercent(0.0);
else
audio_handler_->AdjustVolumeByPercent(-kStepPercentage);
+
+ SendAccessibilityVolumeNotification(
+ audio_handler_->GetVolumePercent(),
+ audio_handler_->IsMuted());
+
ShowVolumeBubble();
}
@@ -199,6 +210,11 @@ void SystemKeyEventListener::OnVolumeUp() {
} else {
audio_handler_->AdjustVolumeByPercent(kStepPercentage);
}
+
+ SendAccessibilityVolumeNotification(
+ audio_handler_->GetVolumePercent(),
+ audio_handler_->IsMuted());
+
ShowVolumeBubble();
}

Powered by Google App Engine
This is Rietveld 408576698