OLD | NEW |
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/accessibility_util.h" | 5 #include "chrome/browser/chromeos/accessibility_util.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 props.append(queue ? "1;" : "0;"); | 156 props.append(queue ? "1;" : "0;"); |
157 props.append("interruptible="); | 157 props.append("interruptible="); |
158 props.append(interruptible ? "1;" : "0;"); | 158 props.append(interruptible ? "1;" : "0;"); |
159 chromeos::DBusThreadManager::Get()->GetSpeechSynthesizerClient()-> | 159 chromeos::DBusThreadManager::Get()->GetSpeechSynthesizerClient()-> |
160 SetSpeakProperties(props); | 160 SetSpeakProperties(props); |
161 } | 161 } |
162 chromeos::DBusThreadManager::Get()->GetSpeechSynthesizerClient()-> | 162 chromeos::DBusThreadManager::Get()->GetSpeechSynthesizerClient()-> |
163 Speak(speak_str); | 163 Speak(speak_str); |
164 } | 164 } |
165 | 165 |
| 166 void MaybeSpeak(const char* speak_str, bool queue, bool interruptible) { |
| 167 if (!g_browser_process) { |
| 168 return; |
| 169 } |
| 170 PrefService* prefs = g_browser_process->local_state(); |
| 171 bool accessibility_enabled = prefs && |
| 172 prefs->GetBoolean(prefs::kAccessibilityEnabled); |
| 173 if (accessibility_enabled) { |
| 174 Speak(speak_str, queue, interruptible); |
| 175 } |
| 176 } |
166 | 177 |
167 } // namespace accessibility | 178 } // namespace accessibility |
168 } // namespace chromeos | 179 } // namespace chromeos |
OLD | NEW |