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

Side by Side Diff: chrome/browser/chromeos/input_method/mock_input_method_manager.h

Issue 18856014: We should switch the keyboard layout to the layout the user set according to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Diff versus master. Created 7 years, 5 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_
7 7
8 #include "chrome/browser/chromeos/input_method/input_method_util.h" 8 #include "chrome/browser/chromeos/input_method/input_method_util.h"
9 #include "chromeos/ime/fake_input_method_delegate.h" 9 #include "chromeos/ime/fake_input_method_delegate.h"
10 #include "chromeos/ime/input_method_manager.h" 10 #include "chromeos/ime/input_method_manager.h"
(...skipping 13 matching lines...) Expand all
24 virtual void AddObserver(InputMethodManager::Observer* observer) OVERRIDE; 24 virtual void AddObserver(InputMethodManager::Observer* observer) OVERRIDE;
25 virtual void AddCandidateWindowObserver( 25 virtual void AddCandidateWindowObserver(
26 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; 26 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE;
27 virtual void RemoveObserver(InputMethodManager::Observer* observer) OVERRIDE; 27 virtual void RemoveObserver(InputMethodManager::Observer* observer) OVERRIDE;
28 virtual void RemoveCandidateWindowObserver( 28 virtual void RemoveCandidateWindowObserver(
29 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; 29 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE;
30 virtual scoped_ptr<InputMethodDescriptors> 30 virtual scoped_ptr<InputMethodDescriptors>
31 GetSupportedInputMethods() const OVERRIDE; 31 GetSupportedInputMethods() const OVERRIDE;
32 virtual scoped_ptr<InputMethodDescriptors> 32 virtual scoped_ptr<InputMethodDescriptors>
33 GetActiveInputMethods() const OVERRIDE; 33 GetActiveInputMethods() const OVERRIDE;
34 virtual const std::vector<std::string>& GetActiveInputMethodIds() const
35 OVERRIDE;
34 virtual size_t GetNumActiveInputMethods() const OVERRIDE; 36 virtual size_t GetNumActiveInputMethods() const OVERRIDE;
35 virtual void EnableLayouts(const std::string& language_code, 37 virtual void EnableLayouts(const std::string& language_code,
36 const std::string& initial_layout) OVERRIDE; 38 const std::string& initial_layout) OVERRIDE;
37 virtual bool EnableInputMethods( 39 virtual bool EnableInputMethods(
38 const std::vector<std::string>& new_active_input_method_ids) OVERRIDE; 40 const std::vector<std::string>& new_active_input_method_ids) OVERRIDE;
41 virtual bool EnableInputMethod(
42 const std::string& new_active_input_method_id) OVERRIDE;
39 virtual bool MigrateOldInputMethods( 43 virtual bool MigrateOldInputMethods(
40 std::vector<std::string>* input_method_ids) OVERRIDE; 44 std::vector<std::string>* input_method_ids) OVERRIDE;
41 virtual bool MigrateKoreanKeyboard( 45 virtual bool MigrateKoreanKeyboard(
42 const std::string& keyboard_id, 46 const std::string& keyboard_id,
43 std::vector<std::string>* input_method_ids) OVERRIDE; 47 std::vector<std::string>* input_method_ids) OVERRIDE;
44 virtual bool SetInputMethodConfig( 48 virtual bool SetInputMethodConfig(
45 const std::string& section, 49 const std::string& section,
46 const std::string& config_name, 50 const std::string& config_name,
47 const InputMethodConfigValue& value) OVERRIDE; 51 const InputMethodConfigValue& value) OVERRIDE;
48 virtual void ChangeInputMethod(const std::string& input_method_id) OVERRIDE; 52 virtual void ChangeInputMethod(const std::string& input_method_id) OVERRIDE;
(...skipping 12 matching lines...) Expand all
61 virtual bool SwitchToNextInputMethod() OVERRIDE; 65 virtual bool SwitchToNextInputMethod() OVERRIDE;
62 virtual bool SwitchToPreviousInputMethod() OVERRIDE; 66 virtual bool SwitchToPreviousInputMethod() OVERRIDE;
63 virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) OVERRIDE; 67 virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) OVERRIDE;
64 virtual InputMethodDescriptor GetCurrentInputMethod() const OVERRIDE; 68 virtual InputMethodDescriptor GetCurrentInputMethod() const OVERRIDE;
65 virtual InputMethodPropertyList 69 virtual InputMethodPropertyList
66 GetCurrentInputMethodProperties() const OVERRIDE; 70 GetCurrentInputMethodProperties() const OVERRIDE;
67 virtual XKeyboard* GetXKeyboard() OVERRIDE; 71 virtual XKeyboard* GetXKeyboard() OVERRIDE;
68 virtual InputMethodUtil* GetInputMethodUtil() OVERRIDE; 72 virtual InputMethodUtil* GetInputMethodUtil() OVERRIDE;
69 virtual ComponentExtensionIMEManager* 73 virtual ComponentExtensionIMEManager*
70 GetComponentExtensionIMEManager() OVERRIDE; 74 GetComponentExtensionIMEManager() OVERRIDE;
75 virtual bool IsFullLatinKeyboard(const std::string& layout) const OVERRIDE;
71 76
72 // Sets an input method ID which will be returned by GetCurrentInputMethod(). 77 // Sets an input method ID which will be returned by GetCurrentInputMethod().
73 void SetCurrentInputMethodId(const std::string& input_method_id) { 78 void SetCurrentInputMethodId(const std::string& input_method_id) {
74 current_input_method_id_ = input_method_id; 79 current_input_method_id_ = input_method_id;
75 } 80 }
76 81
77 // Set values that will be provided to the InputMethodUtil. 82 // Set values that will be provided to the InputMethodUtil.
78 void set_application_locale(const std::string& value); 83 void set_application_locale(const std::string& value);
79 void set_hardware_keyboard_layout(const std::string& value); 84 void set_hardware_keyboard_layout(const std::string& value);
80 85
81 // TODO(yusukes): Add more variables for counting the numbers of the API calls 86 // TODO(yusukes): Add more variables for counting the numbers of the API calls
82 int add_observer_count_; 87 int add_observer_count_;
83 int remove_observer_count_; 88 int remove_observer_count_;
84 89
85 private: 90 private:
86 // The value GetCurrentInputMethod().id() will return. 91 // The value GetCurrentInputMethod().id() will return.
87 std::string current_input_method_id_; 92 std::string current_input_method_id_;
88 93
89 InputMethodWhitelist whitelist_; 94 InputMethodWhitelist whitelist_;
90 FakeInputMethodDelegate delegate_; // used by util_ 95 FakeInputMethodDelegate delegate_; // used by util_
91 InputMethodUtil util_; 96 InputMethodUtil util_;
92 MockXKeyboard xkeyboard_; 97 MockXKeyboard xkeyboard_;
93 98
99 // The active input method ids cache (actually default only)
100 std::vector<std::string> active_input_method_ids_;
101
94 DISALLOW_COPY_AND_ASSIGN(MockInputMethodManager); 102 DISALLOW_COPY_AND_ASSIGN(MockInputMethodManager);
95 }; 103 };
96 104
97 } // namespace input_method 105 } // namespace input_method
98 } // namespace chromeos 106 } // namespace chromeos
99 107
100 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ 108 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698