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

Unified Diff: chrome/browser/chromeos/login/wizard_accessibility_helper.cc

Issue 6283009: Unregister access notifications when accessibility is turned off (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/wizard_accessibility_helper.cc
===================================================================
--- chrome/browser/chromeos/login/wizard_accessibility_helper.cc (revision 72230)
+++ chrome/browser/chromeos/login/wizard_accessibility_helper.cc (working copy)
@@ -118,10 +118,13 @@
EnableAccessibilityForView(view_tree);
} else {
SetAccessibilityEnabled(false);
+ if (registered_notifications_)
+ UnregisterNotifications();
}
}
void WizardAccessibilityHelper::SetAccessibilityEnabled(bool enabled) {
+ bool doSpeak = (IsAccessibilityEnabled() != enabled);
if (g_browser_process) {
PrefService* prefService = g_browser_process->local_state();
prefService->SetBoolean(prefs::kAccessibilityEnabled, enabled);
@@ -129,10 +132,12 @@
}
ExtensionAccessibilityEventRouter::GetInstance()->
SetAccessibilityEnabled(enabled);
- accessibility_handler_->Speak(enabled ?
- l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_ENABLED).c_str() :
- l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_DISABLED).c_str(),
- false, true);
+ if (doSpeak) {
+ accessibility_handler_->Speak(enabled ?
+ l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_ENABLED).c_str() :
+ l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_DISABLED).c_str(),
+ false, true);
+ }
}
void WizardAccessibilityHelper::AddViewToBuffer(views::View* view_tree) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698