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

Side by Side Diff: chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc

Issue 419293002: IME refactoring: ChromeOS introduce input methods State. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 6 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
OLDNEW
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/magnifier/magnification_controller.h" 7 #include "ash/magnifier/magnification_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 return GetPrefs()->GetBoolean(prefs::kAccessibilityAutoclickEnabled); 196 return GetPrefs()->GetBoolean(prefs::kAccessibilityAutoclickEnabled);
197 } 197 }
198 198
199 int GetAutoclickDelayFromPref() { 199 int GetAutoclickDelayFromPref() {
200 return GetPrefs()->GetInteger(prefs::kAccessibilityAutoclickDelayMs); 200 return GetPrefs()->GetInteger(prefs::kAccessibilityAutoclickDelayMs);
201 } 201 }
202 202
203 bool IsBrailleImeActive() { 203 bool IsBrailleImeActive() {
204 InputMethodManager* imm = InputMethodManager::Get(); 204 InputMethodManager* imm = InputMethodManager::Get();
205 scoped_ptr<InputMethodDescriptors> descriptors = 205 scoped_ptr<InputMethodDescriptors> descriptors =
206 imm->GetActiveInputMethods(); 206 imm->GetActiveIMEState()->GetActiveInputMethods();
207 for (InputMethodDescriptors::const_iterator i = descriptors->begin(); 207 for (InputMethodDescriptors::const_iterator i = descriptors->begin();
208 i != descriptors->end(); 208 i != descriptors->end();
209 ++i) { 209 ++i) {
210 if (i->id() == extension_misc::kBrailleImeEngineId) 210 if (i->id() == extension_misc::kBrailleImeEngineId)
211 return true; 211 return true;
212 } 212 }
213 return false; 213 return false;
214 } 214 }
215 215
216 bool IsBrailleImeCurrent() { 216 bool IsBrailleImeCurrent() {
217 InputMethodManager* imm = InputMethodManager::Get(); 217 InputMethodManager* imm = InputMethodManager::Get();
218 return imm->GetCurrentInputMethod().id() == 218 return imm->GetActiveIMEState()->GetCurrentInputMethod().id() ==
219 extension_misc::kBrailleImeEngineId; 219 extension_misc::kBrailleImeEngineId;
220 } 220 }
221 } // anonymous namespace 221 } // anonymous namespace
222 222
223 class AccessibilityManagerTest : public InProcessBrowserTest { 223 class AccessibilityManagerTest : public InProcessBrowserTest {
224 protected: 224 protected:
225 AccessibilityManagerTest() : default_autoclick_delay_(0) {} 225 AccessibilityManagerTest() : default_autoclick_delay_(0) {}
226 virtual ~AccessibilityManagerTest() {} 226 virtual ~AccessibilityManagerTest() {}
227 227
228 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 228 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 EXPECT_FALSE(ShouldShowAccessibilityMenu()); 696 EXPECT_FALSE(ShouldShowAccessibilityMenu());
697 697
698 // Check on-screen keyboard. 698 // Check on-screen keyboard.
699 SetVirtualKeyboardEnabled(true); 699 SetVirtualKeyboardEnabled(true);
700 EXPECT_TRUE(ShouldShowAccessibilityMenu()); 700 EXPECT_TRUE(ShouldShowAccessibilityMenu());
701 SetVirtualKeyboardEnabled(false); 701 SetVirtualKeyboardEnabled(false);
702 EXPECT_FALSE(ShouldShowAccessibilityMenu()); 702 EXPECT_FALSE(ShouldShowAccessibilityMenu());
703 } 703 }
704 704
705 } // namespace chromeos 705 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698