| OLD | NEW |
| (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 } |
| OLD | NEW |