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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Name: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/login/wizard_accessibility_handler.h"
6
7 #include "chrome/browser/accessibility_events.h"
8 #include "chrome/browser/chromeos/cros/cros_library.h"
9 #include "chrome/browser/chromeos/cros/speech_synthesis_library.h"
10 #include "chrome/common/notification_service.h"
11
12 void WizardAccessibilityHandler::Observe(
13 NotificationType type,
14 const NotificationSource& source,
15 const NotificationDetails& details) {
16 const AccessibilityControlInfo *info = NULL;
17 info = Details<const AccessibilityControlInfo>(details).ptr();
18 switch (type.value) {
19 case NotificationType::ACCESSIBILITY_CONTROL_FOCUSED:
20 Speak(info->name().c_str());
21 break;
22 case NotificationType::ACCESSIBILITY_CONTROL_ACTION:
23 break;
24 case NotificationType::ACCESSIBILITY_TEXT_CHANGED:
25 break;
26 case NotificationType::ACCESSIBILITY_MENU_OPENED:
27 break;
28 case NotificationType::ACCESSIBILITY_MENU_CLOSED:
29 break;
30 default:
31 NOTREACHED() << "Cannot recognize notification type: " << type.value;
32 break;
33 }
34 }
35
36 void WizardAccessibilityHandler::Speak(const char* speak_str) {
37 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) {
38 chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()->
39 StopSpeaking();
40 chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()->
41 Speak(speak_str);
42 }
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698