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

Unified Diff: chrome/browser/chromeos/accessibility_util.cc

Issue 7781004: Move Speak() in accessibility_utils, speak enable and disable strings when (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unused headers Created 9 years, 4 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
Index: chrome/browser/chromeos/accessibility_util.cc
diff --git a/chrome/browser/chromeos/accessibility_util.cc b/chrome/browser/chromeos/accessibility_util.cc
index a0628849ca6d61d13faf70056ec8030c09f524eb..b487e78e8bcab31a63219b443dc3289ddb3b80e6 100644
--- a/chrome/browser/chromeos/accessibility_util.cc
+++ b/chrome/browser/chromeos/accessibility_util.cc
@@ -7,6 +7,8 @@
#include "base/callback.h"
#include "base/logging.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/chromeos/cros/cros_library.h"
+#include "chrome/browser/chromeos/cros/speech_synthesis_library.h"
#include "chrome/browser/extensions/extension_accessibility_api.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/file_reader.h"
@@ -19,6 +21,8 @@
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/webui/web_ui.h"
#include "grit/browser_resources.h"
+#include "grit/generated_resources.h"
+#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
namespace chromeos {
@@ -97,6 +101,11 @@ void EnableAccessibility(bool enabled, WebUI* login_web_ui) {
ExtensionAccessibilityEventRouter::GetInstance()->
SetAccessibilityEnabled(enabled);
+ Speak(enabled ?
+ l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_ENABLED).c_str() :
+ l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_DISABLED).c_str(),
+ false, true);
+
// Load/Unload ChromeVox
Profile* profile = ProfileManager::GetDefaultProfile();
ExtensionService* extension_service =
@@ -145,5 +154,22 @@ void ToggleAccessibility(WebUI* login_web_ui) {
EnableAccessibility(accessibility_enabled, login_web_ui);
};
+void Speak(const char* speak_str, bool queue, bool interruptible) {
+ if (chromeos::CrosLibrary::Get()->EnsureLoaded()) {
+ if (queue || !interruptible) {
+ std::string props = "";
+ props.append("enqueue=");
+ props.append(queue ? "1;" : "0;");
+ props.append("interruptible=");
+ props.append(interruptible ? "1;" : "0;");
+ chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()->
+ SetSpeakProperties(props.c_str());
+ }
+ chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()->
+ Speak(speak_str);
+ }
+}
+
+
} // namespace accessibility
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/accessibility_util.h ('k') | chrome/browser/chromeos/login/wizard_accessibility_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698