| 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/accessibility_types.h" | 7 #include "ash/accessibility_types.h" |
| 8 #include "ash/magnifier/magnification_controller.h" | 8 #include "ash/magnifier/magnification_controller.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "chromeos/chromeos_switches.h" | 27 #include "chromeos/chromeos_switches.h" |
| 28 #include "components/prefs/pref_service.h" | 28 #include "components/prefs/pref_service.h" |
| 29 #include "components/session_manager/core/session_manager.h" | 29 #include "components/session_manager/core/session_manager.h" |
| 30 #include "components/signin/core/account_id/account_id.h" | 30 #include "components/signin/core/account_id/account_id.h" |
| 31 #include "components/sync_preferences/pref_service_syncable.h" | 31 #include "components/sync_preferences/pref_service_syncable.h" |
| 32 #include "components/user_manager/user_names.h" | 32 #include "components/user_manager/user_names.h" |
| 33 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
| 34 #include "content/public/test/test_utils.h" | 34 #include "content/public/test/test_utils.h" |
| 35 #include "testing/gtest/include/gtest/gtest.h" | 35 #include "testing/gtest/include/gtest/gtest.h" |
| 36 #include "ui/base/ime/chromeos/component_extension_ime_manager.h" | 36 #include "ui/base/ime/chromeos/component_extension_ime_manager.h" |
| 37 #include "ui/base/ime/chromeos/extension_ime_util.h" |
| 37 #include "ui/base/ime/chromeos/input_method_manager.h" | 38 #include "ui/base/ime/chromeos/input_method_manager.h" |
| 38 | 39 |
| 39 using chromeos::input_method::InputMethodManager; | 40 using chromeos::input_method::InputMethodManager; |
| 40 using chromeos::input_method::InputMethodUtil; | 41 using chromeos::input_method::InputMethodUtil; |
| 41 using chromeos::input_method::InputMethodDescriptors; | 42 using chromeos::input_method::InputMethodDescriptors; |
| 42 using content::BrowserThread; | 43 using content::BrowserThread; |
| 43 using extensions::api::braille_display_private::BrailleObserver; | 44 using extensions::api::braille_display_private::BrailleObserver; |
| 44 using extensions::api::braille_display_private::DisplayState; | 45 using extensions::api::braille_display_private::DisplayState; |
| 45 using extensions::api::braille_display_private::KeyEvent; | 46 using extensions::api::braille_display_private::KeyEvent; |
| 46 using extensions::api::braille_display_private::MockBrailleController; | 47 using extensions::api::braille_display_private::MockBrailleController; |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 return GetPrefs()->GetBoolean(prefs::kAccessibilityMonoAudioEnabled); | 221 return GetPrefs()->GetBoolean(prefs::kAccessibilityMonoAudioEnabled); |
| 221 } | 222 } |
| 222 | 223 |
| 223 bool IsBrailleImeActive() { | 224 bool IsBrailleImeActive() { |
| 224 InputMethodManager* imm = InputMethodManager::Get(); | 225 InputMethodManager* imm = InputMethodManager::Get(); |
| 225 std::unique_ptr<InputMethodDescriptors> descriptors = | 226 std::unique_ptr<InputMethodDescriptors> descriptors = |
| 226 imm->GetActiveIMEState()->GetActiveInputMethods(); | 227 imm->GetActiveIMEState()->GetActiveInputMethods(); |
| 227 for (InputMethodDescriptors::const_iterator i = descriptors->begin(); | 228 for (InputMethodDescriptors::const_iterator i = descriptors->begin(); |
| 228 i != descriptors->end(); | 229 i != descriptors->end(); |
| 229 ++i) { | 230 ++i) { |
| 230 if (i->id() == extension_misc::kBrailleImeEngineId) | 231 if (i->id() == extension_ime_util::kBrailleImeEngineId) |
| 231 return true; | 232 return true; |
| 232 } | 233 } |
| 233 return false; | 234 return false; |
| 234 } | 235 } |
| 235 | 236 |
| 236 bool IsBrailleImeCurrent() { | 237 bool IsBrailleImeCurrent() { |
| 237 InputMethodManager* imm = InputMethodManager::Get(); | 238 InputMethodManager* imm = InputMethodManager::Get(); |
| 238 return imm->GetActiveIMEState()->GetCurrentInputMethod().id() == | 239 return imm->GetActiveIMEState()->GetCurrentInputMethod().id() == |
| 239 extension_misc::kBrailleImeEngineId; | 240 extension_ime_util::kBrailleImeEngineId; |
| 240 } | 241 } |
| 241 } // anonymous namespace | 242 } // anonymous namespace |
| 242 | 243 |
| 243 class AccessibilityManagerTest : public InProcessBrowserTest { | 244 class AccessibilityManagerTest : public InProcessBrowserTest { |
| 244 protected: | 245 protected: |
| 245 AccessibilityManagerTest() : default_autoclick_delay_(0) {} | 246 AccessibilityManagerTest() : default_autoclick_delay_(0) {} |
| 246 ~AccessibilityManagerTest() override {} | 247 ~AccessibilityManagerTest() override {} |
| 247 | 248 |
| 248 void SetUpCommandLine(base::CommandLine* command_line) override { | 249 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 249 command_line->AppendSwitch(chromeos::switches::kLoginManager); | 250 command_line->AppendSwitch(chromeos::switches::kLoginManager); |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 EXPECT_FALSE(ShouldShowAccessibilityMenu()); | 796 EXPECT_FALSE(ShouldShowAccessibilityMenu()); |
| 796 | 797 |
| 797 // Check mono audio output. | 798 // Check mono audio output. |
| 798 SetMonoAudioEnabled(true); | 799 SetMonoAudioEnabled(true); |
| 799 EXPECT_TRUE(ShouldShowAccessibilityMenu()); | 800 EXPECT_TRUE(ShouldShowAccessibilityMenu()); |
| 800 SetMonoAudioEnabled(false); | 801 SetMonoAudioEnabled(false); |
| 801 EXPECT_FALSE(ShouldShowAccessibilityMenu()); | 802 EXPECT_FALSE(ShouldShowAccessibilityMenu()); |
| 802 } | 803 } |
| 803 | 804 |
| 804 } // namespace chromeos | 805 } // namespace chromeos |
| OLD | NEW |