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

Unified Diff: chrome/browser/chromeos/login/wizard_accessibility_handler.cc

Issue 3159028: Add code to initialize accessibility for UI in the ChromeOS startup wizard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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/login/wizard_accessibility_handler.cc
===================================================================
--- chrome/browser/chromeos/login/wizard_accessibility_handler.cc (revision 0)
+++ chrome/browser/chromeos/login/wizard_accessibility_handler.cc (revision 0)
@@ -0,0 +1,43 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/login/wizard_accessibility_handler.h"
+
+#include "chrome/browser/accessibility_events.h"
+#include "chrome/browser/chromeos/cros/cros_library.h"
+#include "chrome/browser/chromeos/cros/speech_synthesis_library.h"
+#include "chrome/common/notification_service.h"
+
+void WizardAccessibilityHandler::Observe(
+ NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ const AccessibilityControlInfo *info = NULL;
+ info = Details<const AccessibilityControlInfo>(details).ptr();
+ switch (type.value) {
+ case NotificationType::ACCESSIBILITY_CONTROL_FOCUSED:
+ Speak(info->name().c_str());
+ break;
+ case NotificationType::ACCESSIBILITY_CONTROL_ACTION:
+ break;
+ case NotificationType::ACCESSIBILITY_TEXT_CHANGED:
+ break;
+ case NotificationType::ACCESSIBILITY_MENU_OPENED:
+ break;
+ case NotificationType::ACCESSIBILITY_MENU_CLOSED:
+ break;
+ default:
+ NOTREACHED() << "Cannot recognize notification type: " << type.value;
+ break;
+ }
+}
+
+void WizardAccessibilityHandler::Speak(const char* speak_str) {
+ if (chromeos::CrosLibrary::Get()->EnsureLoaded()) {
+ chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()->
+ StopSpeaking();
+ chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()->
+ Speak(speak_str);
+ }
+}
Property changes on: chrome/browser/chromeos/login/wizard_accessibility_handler.cc
___________________________________________________________________
Name: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698