| 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 "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 if (!profile_) | 795 if (!profile_) |
| 796 return; | 796 return; |
| 797 | 797 |
| 798 const bool enabled = profile_->GetPrefs()->GetBoolean( | 798 const bool enabled = profile_->GetPrefs()->GetBoolean( |
| 799 prefs::kAccessibilityVirtualKeyboardEnabled); | 799 prefs::kAccessibilityVirtualKeyboardEnabled); |
| 800 | 800 |
| 801 if (virtual_keyboard_enabled_ == enabled) | 801 if (virtual_keyboard_enabled_ == enabled) |
| 802 return; | 802 return; |
| 803 virtual_keyboard_enabled_ = enabled; | 803 virtual_keyboard_enabled_ = enabled; |
| 804 | 804 |
| 805 AccessibilityStatusEventDetails details( | |
| 806 ACCESSIBILITY_TOGGLE_VIRTUAL_KEYBOARD, | |
| 807 enabled, | |
| 808 ui::A11Y_NOTIFICATION_NONE); | |
| 809 | |
| 810 NotifyAccessibilityStatusChanged(details); | |
| 811 | |
| 812 #if defined(USE_ASH) && !defined(USE_ATHENA) | 805 #if defined(USE_ASH) && !defined(USE_ATHENA) |
| 813 keyboard::SetAccessibilityKeyboardEnabled(enabled); | 806 keyboard::SetAccessibilityKeyboardEnabled(enabled); |
| 814 // Note that there are two versions of the on-screen keyboard. A full layout | 807 // Note that there are two versions of the on-screen keyboard. A full layout |
| 815 // is provided for accessibility, which includes sticky modifier keys to | 808 // is provided for accessibility, which includes sticky modifier keys to |
| 816 // enable typing of hotkeys. A compact version is used in touchview mode | 809 // enable typing of hotkeys. A compact version is used in touchview mode |
| 817 // to provide a layout with larger keys to facilitate touch typing. In the | 810 // to provide a layout with larger keys to facilitate touch typing. In the |
| 818 // event that the a11y keyboard is being disabled, an on-screen keyboard might | 811 // event that the a11y keyboard is being disabled, an on-screen keyboard might |
| 819 // still be enabled and a forced reset is required to pick up the layout | 812 // still be enabled and a forced reset is required to pick up the layout |
| 820 // change. | 813 // change. |
| 821 if (keyboard::IsKeyboardEnabled()) | 814 if (keyboard::IsKeyboardEnabled()) |
| 822 ash::Shell::GetInstance()->CreateKeyboard(); | 815 ash::Shell::GetInstance()->CreateKeyboard(); |
| 823 else | 816 else |
| 824 ash::Shell::GetInstance()->DeactivateKeyboard(); | 817 ash::Shell::GetInstance()->DeactivateKeyboard(); |
| 825 #endif | 818 #endif |
| 819 |
| 820 AccessibilityStatusEventDetails details( |
| 821 ACCESSIBILITY_TOGGLE_VIRTUAL_KEYBOARD, |
| 822 enabled, |
| 823 ui::A11Y_NOTIFICATION_NONE); |
| 824 NotifyAccessibilityStatusChanged(details); |
| 826 } | 825 } |
| 827 | 826 |
| 828 bool AccessibilityManager::IsBrailleDisplayConnected() const { | 827 bool AccessibilityManager::IsBrailleDisplayConnected() const { |
| 829 return braille_display_connected_; | 828 return braille_display_connected_; |
| 830 } | 829 } |
| 831 | 830 |
| 832 void AccessibilityManager::CheckBrailleState() { | 831 void AccessibilityManager::CheckBrailleState() { |
| 833 BrailleController* braille_controller = GetBrailleController(); | 832 BrailleController* braille_controller = GetBrailleController(); |
| 834 if (!scoped_braille_observer_.IsObserving(braille_controller)) | 833 if (!scoped_braille_observer_.IsObserving(braille_controller)) |
| 835 scoped_braille_observer_.Add(braille_controller); | 834 scoped_braille_observer_.Add(braille_controller); |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 // Do any teardown work needed immediately after ChromeVox actually unloads. | 1149 // Do any teardown work needed immediately after ChromeVox actually unloads. |
| 1151 if (system_sounds_enabled_) | 1150 if (system_sounds_enabled_) |
| 1152 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); | 1151 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); |
| 1153 #endif | 1152 #endif |
| 1154 // Clear the accessibility focus ring. | 1153 // Clear the accessibility focus ring. |
| 1155 AccessibilityFocusRingController::GetInstance()->SetFocusRing( | 1154 AccessibilityFocusRingController::GetInstance()->SetFocusRing( |
| 1156 std::vector<gfx::Rect>()); | 1155 std::vector<gfx::Rect>()); |
| 1157 } | 1156 } |
| 1158 | 1157 |
| 1159 } // namespace chromeos | 1158 } // namespace chromeos |
| OLD | NEW |