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

Unified Diff: chrome/browser/chromeos/accessibility/accessibility_manager.cc

Issue 42743003: Adjust ChromeVox (spoken feedback) strings and make it possible for announcemen (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixing a few style tidbits. Created 7 years, 2 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/accessibility/accessibility_manager.cc
diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager.cc b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
index 195c9c59170e8ca3017bc54b321cdcfe4ed527dd..33b80d4abd8afa3f7b392e011b876857a1021297 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_manager.cc
+++ b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
@@ -36,6 +36,7 @@
#include "chrome/common/pref_names.h"
#include "chromeos/login/login_state.h"
#include "content/public/browser/browser_accessibility_state.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
@@ -272,8 +273,8 @@ AccessibilityManager::AccessibilityManager()
spoken_feedback_enabled_(false),
high_contrast_enabled_(false),
autoclick_delay_ms_(ash::AutoclickController::kDefaultAutoclickDelayMs),
- spoken_feedback_notification_(ash::A11Y_NOTIFICATION_NONE) {
-
+ spoken_feedback_notification_(ash::A11Y_NOTIFICATION_NONE),
+ should_speak_chrome_vox_announcements_on_user_screen_(true) {
notification_registrar_.Add(this,
chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
content::NotificationService::AllSources());
@@ -387,10 +388,6 @@ void AccessibilityManager::UpdateSpokenFeedbackFromPref() {
spoken_feedback_enabled_ = enabled;
- Speak(l10n_util::GetStringUTF8(
- enabled ? IDS_CHROMEOS_ACC_SPOKEN_FEEDBACK_ENABLED :
- IDS_CHROMEOS_ACC_SPOKEN_FEEDBACK_DISABLED).c_str());
-
ExtensionAccessibilityEventRouter::GetInstance()->
SetAccessibilityEnabled(enabled);
@@ -401,10 +398,27 @@ void AccessibilityManager::UpdateSpokenFeedbackFromPref() {
content::NotificationService::AllSources(),
content::Details<AccessibilityStatusEventDetails>(&details));
- if (enabled)
+ if (enabled) {
LoadChromeVox();
- else
- UnloadChromeVox();
+ ExtensionAccessibilityEventRouter::GetInstance()->
+ OnSpokenFeedbackEnabled(profile_,
+ chrome_vox_loaded_on_lock_screen_ ||
+ should_speak_chrome_vox_announcements_on_user_screen_);
+
+ should_speak_chrome_vox_announcements_on_user_screen_ =
+ chrome_vox_loaded_on_lock_screen_;
+ } else {
+ ExtensionAccessibilityEventRouter::GetInstance()->
+ OnSpokenFeedbackDisabled(profile_);
+
+ // Give ChromeVox a chance to speak/braille outgoing messages.
dmazzoni 2013/10/25 23:09:16 How about "announce" instead of speak/braille
+ content::BrowserThread::PostDelayedTask(
+ content::BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&AccessibilityManager::UnloadChromeVox,
+ base::Unretained(this)),
+ base::TimeDelta::FromSeconds(1));
dmazzoni 2013/10/25 23:09:16 I know it's trivial, but let's make 1 a named cons
+ }
}
void AccessibilityManager::LoadChromeVox() {
@@ -710,6 +724,9 @@ void AccessibilityManager::Observe(
case chrome::NOTIFICATION_SESSION_STARTED:
// Update |profile_| when entering a session.
SetProfile(ProfileManager::GetDefaultProfile());
+
+ // Ensure ChromeVox makes announcements at the start of new sessions.
+ should_speak_chrome_vox_announcements_on_user_screen_ = true;
break;
case chrome::NOTIFICATION_PROFILE_DESTROYED: {
// Update |profile_| when exiting a session or shutting down.

Powered by Google App Engine
This is Rietveld 408576698