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

Side by Side Diff: chrome/browser/chromeos/login/wizard_accessibility_helper.cc

Issue 8511026: Don't start speech synthesis until after the audio mixer is initialized. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium 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 "chrome/browser/chromeos/login/wizard_accessibility_helper.h" 5 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/chromeos/accessibility_util.h" 10 #include "chrome/browser/chromeos/accessibility_util.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 bool WizardAccessibilityHelper::IsAccessibilityEnabled() { 86 bool WizardAccessibilityHelper::IsAccessibilityEnabled() {
87 return g_browser_process && 87 return g_browser_process &&
88 g_browser_process->local_state()->GetBoolean( 88 g_browser_process->local_state()->GetBoolean(
89 prefs::kAccessibilityEnabled); 89 prefs::kAccessibilityEnabled);
90 } 90 }
91 91
92 void WizardAccessibilityHelper::MaybeSpeak(const char* str, bool queue, 92 void WizardAccessibilityHelper::MaybeSpeak(const char* str, bool queue,
93 bool interruptible) { 93 bool interruptible) {
94 if (IsAccessibilityEnabled()) { 94 if (IsAccessibilityEnabled()) {
95 accessibility::Speak(str, queue, interruptible); 95 // Note: queue and interruptible are no longer supported, but
96 // that shouldn't matter because the whole views-based wizard
97 // is obsolete and should be deleted soon.
98 accessibility::Speak(str);
96 } 99 }
97 } 100 }
98 101
99 void WizardAccessibilityHelper::ToggleAccessibility() { 102 void WizardAccessibilityHelper::ToggleAccessibility() {
100 if (!IsAccessibilityEnabled()) { 103 if (!IsAccessibilityEnabled()) {
101 VLOG(1) << "Enabling accessibility."; 104 VLOG(1) << "Enabling accessibility.";
102 if (!registered_notifications_) 105 if (!registered_notifications_)
103 RegisterNotifications(); 106 RegisterNotifications();
104 SetAccessibilityEnabled(true); 107 SetAccessibilityEnabled(true);
105 } else { 108 } else {
106 SetAccessibilityEnabled(false); 109 SetAccessibilityEnabled(false);
107 if (registered_notifications_) 110 if (registered_notifications_)
108 UnregisterNotifications(); 111 UnregisterNotifications();
109 } 112 }
110 } 113 }
111 114
112 void WizardAccessibilityHelper::SetAccessibilityEnabled(bool enabled) { 115 void WizardAccessibilityHelper::SetAccessibilityEnabled(bool enabled) {
113 accessibility::EnableAccessibility(enabled, NULL); 116 accessibility::EnableAccessibility(enabled, NULL);
114 } 117 }
115 118
116 } // namespace chromeos 119 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/wizard_accessibility_handler.cc ('k') | chrome/browser/extensions/extension_tts_api_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698