Chromium Code Reviews| 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" |
| 11 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | |
| 12 #include "chrome/browser/chromeos/dbus/speech_synthesizer_client.h" | |
| 13 #include "chrome/browser/extensions/extension_accessibility_api.h" | 11 #include "chrome/browser/extensions/extension_accessibility_api.h" |
| 12 #include "chrome/browser/extensions/extension_tts_api_platform.h" | |
| 14 #include "chrome/browser/extensions/component_loader.h" | 13 #include "chrome/browser/extensions/component_loader.h" |
| 15 #include "chrome/browser/extensions/extension_service.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
| 16 #include "chrome/browser/extensions/file_reader.h" | 15 #include "chrome/browser/extensions/file_reader.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
| 19 #include "chrome/common/extensions/extension_messages.h" | 18 #include "chrome/common/extensions/extension_messages.h" |
| 20 #include "chrome/common/extensions/extension_resource.h" | 19 #include "chrome/common/extensions/extension_resource.h" |
| 21 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
| 22 #include "content/browser/renderer_host/render_view_host.h" | 21 #include "content/browser/renderer_host/render_view_host.h" |
| 23 #include "content/browser/tab_contents/tab_contents.h" | 22 #include "content/browser/tab_contents/tab_contents.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 } | 141 } |
| 143 | 142 |
| 144 void ToggleAccessibility(WebUI* login_web_ui) { | 143 void ToggleAccessibility(WebUI* login_web_ui) { |
| 145 bool accessibility_enabled = g_browser_process && | 144 bool accessibility_enabled = g_browser_process && |
| 146 g_browser_process->local_state()->GetBoolean( | 145 g_browser_process->local_state()->GetBoolean( |
| 147 prefs::kAccessibilityEnabled); | 146 prefs::kAccessibilityEnabled); |
| 148 accessibility_enabled = !accessibility_enabled; | 147 accessibility_enabled = !accessibility_enabled; |
| 149 EnableAccessibility(accessibility_enabled, login_web_ui); | 148 EnableAccessibility(accessibility_enabled, login_web_ui); |
| 150 }; | 149 }; |
| 151 | 150 |
| 152 void Speak(const char* speak_str, bool queue, bool interruptible) { | 151 void Speak(const char* speak_str, bool queue, bool interruptible) { |
|
oshima
2011/11/09 23:47:32
are "queue" and "interruptable" parameters obsolet
dmazzoni
2011/11/10 07:19:57
Done. They're obsolete assuming that the old views
| |
| 153 if (queue || !interruptible) { | 152 UtteranceContinuousParameters params; |
| 154 std::string props = ""; | 153 ExtensionTtsPlatformImpl::GetInstance()->Speak( |
| 155 props.append("enqueue="); | 154 -1, |
| 156 props.append(queue ? "1;" : "0;"); | 155 speak_str, |
| 157 props.append("interruptible="); | 156 "", |
| 158 props.append(interruptible ? "1;" : "0;"); | 157 params); |
|
oshima
2011/11/09 23:47:32
can you add comment for -1 and ""?
(like -1 /* xy
dmazzoni
2011/11/10 07:19:57
Done. Actually the "" should have been the languag
| |
| 159 chromeos::DBusThreadManager::Get()->GetSpeechSynthesizerClient()-> | |
| 160 SetSpeakProperties(props); | |
| 161 } | |
| 162 chromeos::DBusThreadManager::Get()->GetSpeechSynthesizerClient()-> | |
| 163 Speak(speak_str); | |
| 164 } | 158 } |
| 165 | 159 |
| 166 | 160 |
| 167 } // namespace accessibility | 161 } // namespace accessibility |
| 168 } // namespace chromeos | 162 } // namespace chromeos |
| OLD | NEW |