| 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/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
| 11 #include "chrome/browser/chromeos/cros/speech_synthesis_library.h" | 11 #include "chrome/browser/chromeos/dbus/speech_synthesizer_client.h" |
| 12 #include "chrome/browser/extensions/extension_accessibility_api.h" | 12 #include "chrome/browser/extensions/extension_accessibility_api.h" |
| 13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
| 14 #include "chrome/browser/extensions/file_reader.h" | 14 #include "chrome/browser/extensions/file_reader.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
| 17 #include "chrome/common/extensions/extension_messages.h" | 17 #include "chrome/common/extensions/extension_messages.h" |
| 18 #include "chrome/common/extensions/extension_resource.h" | 18 #include "chrome/common/extensions/extension_resource.h" |
| 19 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
| 20 #include "content/browser/renderer_host/render_view_host.h" | 20 #include "content/browser/renderer_host/render_view_host.h" |
| 21 #include "content/browser/tab_contents/tab_contents.h" | 21 #include "content/browser/tab_contents/tab_contents.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 void ToggleAccessibility(WebUI* login_web_ui) { | 149 void ToggleAccessibility(WebUI* login_web_ui) { |
| 150 bool accessibility_enabled = g_browser_process && | 150 bool accessibility_enabled = g_browser_process && |
| 151 g_browser_process->local_state()->GetBoolean( | 151 g_browser_process->local_state()->GetBoolean( |
| 152 prefs::kAccessibilityEnabled); | 152 prefs::kAccessibilityEnabled); |
| 153 accessibility_enabled = !accessibility_enabled; | 153 accessibility_enabled = !accessibility_enabled; |
| 154 EnableAccessibility(accessibility_enabled, login_web_ui); | 154 EnableAccessibility(accessibility_enabled, login_web_ui); |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 void Speak(const char* speak_str, bool queue, bool interruptible) { | 157 void Speak(const char* speak_str, bool queue, bool interruptible) { |
| 158 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) { | 158 if (queue || !interruptible) { |
| 159 if (queue || !interruptible) { | 159 std::string props = ""; |
| 160 std::string props = ""; | 160 props.append("enqueue="); |
| 161 props.append("enqueue="); | 161 props.append(queue ? "1;" : "0;"); |
| 162 props.append(queue ? "1;" : "0;"); | 162 props.append("interruptible="); |
| 163 props.append("interruptible="); | 163 props.append(interruptible ? "1;" : "0;"); |
| 164 props.append(interruptible ? "1;" : "0;"); | 164 chromeos::DBusThreadManager::Get()->speech_synthesizer_client()-> |
| 165 chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()-> | 165 SetSpeakProperties(props); |
| 166 SetSpeakProperties(props.c_str()); | |
| 167 } | |
| 168 chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()-> | |
| 169 Speak(speak_str); | |
| 170 } | 166 } |
| 167 chromeos::DBusThreadManager::Get()->speech_synthesizer_client()-> |
| 168 Speak(speak_str); |
| 171 } | 169 } |
| 172 | 170 |
| 173 | 171 |
| 174 } // namespace accessibility | 172 } // namespace accessibility |
| 175 } // namespace chromeos | 173 } // namespace chromeos |
| OLD | NEW |