OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/accessibility_manager.h" | 5 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
6 | 6 |
7 #include "ash/autoclick/autoclick_controller.h" | 7 #include "ash/autoclick/autoclick_controller.h" |
8 #include "ash/high_contrast/high_contrast_controller.h" | 8 #include "ash/high_contrast/high_contrast_controller.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/system/tray/system_tray_notifier.h" | 10 #include "ash/system/tray/system_tray_notifier.h" |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 | 415 |
416 AccessibilityStatusEventDetails details(enabled, | 416 AccessibilityStatusEventDetails details(enabled, |
417 spoken_feedback_notification_); | 417 spoken_feedback_notification_); |
418 content::NotificationService::current()->Notify( | 418 content::NotificationService::current()->Notify( |
419 chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK, | 419 chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK, |
420 content::NotificationService::AllSources(), | 420 content::NotificationService::AllSources(), |
421 content::Details<AccessibilityStatusEventDetails>(&details)); | 421 content::Details<AccessibilityStatusEventDetails>(&details)); |
422 | 422 |
423 if (enabled) { | 423 if (enabled) { |
424 LoadChromeVox(); | 424 LoadChromeVox(); |
425 ExtensionAccessibilityEventRouter::GetInstance()-> | |
426 OnChromeVoxLoadStateChanged(profile_, | |
427 true, | |
428 chrome_vox_loaded_on_lock_screen_ || | |
429 should_speak_chrome_vox_announcements_on_user_screen_); | |
430 | |
431 should_speak_chrome_vox_announcements_on_user_screen_ = | |
432 chrome_vox_loaded_on_lock_screen_; | |
433 } else { | 425 } else { |
434 ExtensionAccessibilityEventRouter::GetInstance()-> | 426 ExtensionAccessibilityEventRouter::GetInstance()-> |
435 OnChromeVoxLoadStateChanged(profile_, false, false); | 427 OnChromeVoxLoadStateChanged(profile_, false, false); |
436 } | 428 } |
437 } | 429 } |
438 | 430 |
439 void AccessibilityManager::LoadChromeVox() { | 431 void AccessibilityManager::LoadChromeVox() { |
440 ScreenLocker* screen_locker = ScreenLocker::default_screen_locker(); | 432 ScreenLocker* screen_locker = ScreenLocker::default_screen_locker(); |
441 if (screen_locker && screen_locker->locked()) { | 433 if (screen_locker && screen_locker->locked()) { |
442 // If on the lock screen, loads ChromeVox only to the lock screen as for | 434 // If on the lock screen, loads ChromeVox only to the lock screen as for |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 | 821 |
830 void AccessibilityManager::OnListenerRemoved( | 822 void AccessibilityManager::OnListenerRemoved( |
831 const extensions::EventListenerInfo& details) { | 823 const extensions::EventListenerInfo& details) { |
832 if (details.extension_id != extension_misc::kChromeVoxExtensionId) | 824 if (details.extension_id != extension_misc::kChromeVoxExtensionId) |
833 return; | 825 return; |
834 | 826 |
835 UnloadChromeVox(); | 827 UnloadChromeVox(); |
836 } | 828 } |
837 | 829 |
838 } // namespace chromeos | 830 } // namespace chromeos |
OLD | NEW |