OLD | NEW |
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_INPUT_METHOD_MANAGER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 virtual void EnableLoginLayouts( | 58 virtual void EnableLoginLayouts( |
59 const std::string& language_code, | 59 const std::string& language_code, |
60 const std::vector<std::string>& initial_layouts) OVERRIDE; | 60 const std::vector<std::string>& initial_layouts) OVERRIDE; |
61 virtual bool ReplaceEnabledInputMethods( | 61 virtual bool ReplaceEnabledInputMethods( |
62 const std::vector<std::string>& new_active_input_method_ids) OVERRIDE; | 62 const std::vector<std::string>& new_active_input_method_ids) OVERRIDE; |
63 virtual bool EnableInputMethod(const std::string& new_active_input_method_id) | 63 virtual bool EnableInputMethod(const std::string& new_active_input_method_id) |
64 OVERRIDE; | 64 OVERRIDE; |
65 virtual void ChangeInputMethod(const std::string& input_method_id) OVERRIDE; | 65 virtual void ChangeInputMethod(const std::string& input_method_id) OVERRIDE; |
66 virtual void ActivateInputMethodMenuItem(const std::string& key) OVERRIDE; | 66 virtual void ActivateInputMethodMenuItem(const std::string& key) OVERRIDE; |
67 virtual void AddInputMethodExtension( | 67 virtual void AddInputMethodExtension( |
| 68 Profile* profile, |
68 const std::string& id, | 69 const std::string& id, |
69 InputMethodEngineInterface* instance) OVERRIDE; | 70 InputMethodEngineInterface* instance) OVERRIDE; |
70 virtual void RemoveInputMethodExtension(const std::string& id) OVERRIDE; | 71 virtual void RemoveInputMethodExtension(Profile* profile, |
| 72 const std::string& id) OVERRIDE; |
71 virtual void GetInputMethodExtensions( | 73 virtual void GetInputMethodExtensions( |
72 InputMethodDescriptors* result) OVERRIDE; | 74 InputMethodDescriptors* result) OVERRIDE; |
73 virtual void SetEnabledExtensionImes(std::vector<std::string>* ids) OVERRIDE; | 75 virtual void SetEnabledExtensionImes(std::vector<std::string>* ids) OVERRIDE; |
74 virtual void SetInputMethodLoginDefault() OVERRIDE; | 76 virtual void SetInputMethodLoginDefault() OVERRIDE; |
75 virtual void SetInputMethodLoginDefaultFromVPD( | 77 virtual void SetInputMethodLoginDefaultFromVPD( |
76 const std::string& locale, const std::string& layout) OVERRIDE; | 78 const std::string& locale, const std::string& layout) OVERRIDE; |
77 virtual bool SwitchToNextInputMethod() OVERRIDE; | 79 virtual bool SwitchToNextInputMethod() OVERRIDE; |
78 virtual bool SwitchToPreviousInputMethod( | 80 virtual bool SwitchToPreviousInputMethod( |
79 const ui::Accelerator& accelerator) OVERRIDE; | 81 const ui::Accelerator& accelerator) OVERRIDE; |
80 virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) OVERRIDE; | 82 virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) OVERRIDE; |
(...skipping 13 matching lines...) Expand all Loading... |
94 // Sets |candidate_window_controller_|. | 96 // Sets |candidate_window_controller_|. |
95 void SetCandidateWindowControllerForTesting( | 97 void SetCandidateWindowControllerForTesting( |
96 CandidateWindowController* candidate_window_controller); | 98 CandidateWindowController* candidate_window_controller); |
97 // Sets |keyboard_|. | 99 // Sets |keyboard_|. |
98 void SetImeKeyboardForTesting(ImeKeyboard* keyboard); | 100 void SetImeKeyboardForTesting(ImeKeyboard* keyboard); |
99 // Initialize |component_extension_manager_|. | 101 // Initialize |component_extension_manager_|. |
100 void InitializeComponentExtensionForTesting( | 102 void InitializeComponentExtensionForTesting( |
101 scoped_ptr<ComponentExtensionIMEManagerDelegate> delegate); | 103 scoped_ptr<ComponentExtensionIMEManagerDelegate> delegate); |
102 | 104 |
103 private: | 105 private: |
| 106 friend class InputMethodManagerImplTest; |
| 107 |
104 // CandidateWindowController::Observer overrides: | 108 // CandidateWindowController::Observer overrides: |
105 virtual void CandidateClicked(int index) OVERRIDE; | 109 virtual void CandidateClicked(int index) OVERRIDE; |
106 virtual void CandidateWindowOpened() OVERRIDE; | 110 virtual void CandidateWindowOpened() OVERRIDE; |
107 virtual void CandidateWindowClosed() OVERRIDE; | 111 virtual void CandidateWindowClosed() OVERRIDE; |
108 | 112 |
109 // Temporarily deactivates all input methods (e.g. Chinese, Japanese, Arabic) | 113 // Temporarily deactivates all input methods (e.g. Chinese, Japanese, Arabic) |
110 // since they are not necessary to input a login password. Users are still | 114 // since they are not necessary to input a login password. Users are still |
111 // able to use/switch active keyboard layouts (e.g. US qwerty, US dvorak, | 115 // able to use/switch active keyboard layouts (e.g. US qwerty, US dvorak, |
112 // French). | 116 // French). |
113 void OnScreenLocked(); | 117 void OnScreenLocked(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // Adds new input method to given list if possible | 150 // Adds new input method to given list if possible |
147 bool EnableInputMethodImpl( | 151 bool EnableInputMethodImpl( |
148 const std::string& input_method_id, | 152 const std::string& input_method_id, |
149 std::vector<std::string>* new_active_input_method_ids) const; | 153 std::vector<std::string>* new_active_input_method_ids) const; |
150 | 154 |
151 // Starts or stops the system input method framework as needed. | 155 // Starts or stops the system input method framework as needed. |
152 // (after list of enabled input methods has been updated) | 156 // (after list of enabled input methods has been updated) |
153 void ReconfigureIMFramework(); | 157 void ReconfigureIMFramework(); |
154 | 158 |
155 // Gets the current active user profile. | 159 // Gets the current active user profile. |
| 160 // Note: this method is deprecated as ActiveUserProfile might change |
| 161 // during asynchronous operations that leads to strange crashes. |
| 162 // Use with caution! |
156 Profile* GetProfile() const; | 163 Profile* GetProfile() const; |
157 | 164 |
158 scoped_ptr<InputMethodDelegate> delegate_; | 165 scoped_ptr<InputMethodDelegate> delegate_; |
159 | 166 |
160 // The current browser status. | 167 // The current browser status. |
161 State state_; | 168 State state_; |
162 | 169 |
163 // A list of objects that monitor the manager. | 170 // A list of objects that monitor the manager. |
164 ObserverList<InputMethodManager::Observer> observers_; | 171 ObserverList<InputMethodManager::Observer> observers_; |
165 ObserverList<CandidateWindowObserver> candidate_window_observers_; | 172 ObserverList<CandidateWindowObserver> candidate_window_observers_; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 typedef std::map<Profile*, EngineMap, ProfileCompare> ProfileEngineMap; | 217 typedef std::map<Profile*, EngineMap, ProfileCompare> ProfileEngineMap; |
211 ProfileEngineMap profile_engine_map_; | 218 ProfileEngineMap profile_engine_map_; |
212 | 219 |
213 DISALLOW_COPY_AND_ASSIGN(InputMethodManagerImpl); | 220 DISALLOW_COPY_AND_ASSIGN(InputMethodManagerImpl); |
214 }; | 221 }; |
215 | 222 |
216 } // namespace input_method | 223 } // namespace input_method |
217 } // namespace chromeos | 224 } // namespace chromeos |
218 | 225 |
219 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_H_ | 226 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_H_ |
OLD | NEW |