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 const std::string& id, | 68 const std::string& extension_id, |
69 const InputMethodDescriptors& descriptors, | |
69 InputMethodEngineInterface* instance) OVERRIDE; | 70 InputMethodEngineInterface* instance) OVERRIDE; |
70 virtual void RemoveInputMethodExtension(const std::string& id) OVERRIDE; | 71 virtual void RemoveInputMethodExtension( |
72 const std::string& extension_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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 | 147 |
146 // Adds new input method to given list if possible | 148 // Adds new input method to given list if possible |
147 bool EnableInputMethodImpl( | 149 bool EnableInputMethodImpl( |
148 const std::string& input_method_id, | 150 const std::string& input_method_id, |
149 std::vector<std::string>* new_active_input_method_ids) const; | 151 std::vector<std::string>* new_active_input_method_ids) const; |
150 | 152 |
151 // Starts or stops the system input method framework as needed. | 153 // Starts or stops the system input method framework as needed. |
152 // (after list of enabled input methods has been updated) | 154 // (after list of enabled input methods has been updated) |
153 void ReconfigureIMFramework(); | 155 void ReconfigureIMFramework(); |
154 | 156 |
155 // Gets the current active user profile. | |
156 Profile* GetProfile() const; | |
157 | |
158 scoped_ptr<InputMethodDelegate> delegate_; | 157 scoped_ptr<InputMethodDelegate> delegate_; |
159 | 158 |
160 // The current browser status. | 159 // The current browser status. |
161 State state_; | 160 State state_; |
162 | 161 |
163 // A list of objects that monitor the manager. | 162 // A list of objects that monitor the manager. |
164 ObserverList<InputMethodManager::Observer> observers_; | 163 ObserverList<InputMethodManager::Observer> observers_; |
165 ObserverList<CandidateWindowObserver> candidate_window_observers_; | 164 ObserverList<CandidateWindowObserver> candidate_window_observers_; |
166 | 165 |
167 // The input method which was/is selected. | 166 // The input method which was/is selected. |
(...skipping 28 matching lines...) Expand all Loading... | |
196 scoped_ptr<ComponentExtensionIMEManager> component_extension_ime_manager_; | 195 scoped_ptr<ComponentExtensionIMEManager> component_extension_ime_manager_; |
197 | 196 |
198 // An object for switching XKB layouts and keyboard status like caps lock and | 197 // An object for switching XKB layouts and keyboard status like caps lock and |
199 // auto-repeat interval. | 198 // auto-repeat interval. |
200 scoped_ptr<ImeKeyboard> keyboard_; | 199 scoped_ptr<ImeKeyboard> keyboard_; |
201 | 200 |
202 base::ThreadChecker thread_checker_; | 201 base::ThreadChecker thread_checker_; |
203 | 202 |
204 base::WeakPtrFactory<InputMethodManagerImpl> weak_ptr_factory_; | 203 base::WeakPtrFactory<InputMethodManagerImpl> weak_ptr_factory_; |
205 | 204 |
206 // The engine map: | 205 std::map<std::string, InputMethodEngineInterface*> engine_map_; |
Yuki
2014/08/05 07:57:18
The original comment was very useful, and it's sti
Shu Chen
2014/08/05 14:04:31
Done.
| |
207 // { Profile : { input_method_id : Engine } }. | |
208 typedef std::map<std::string, InputMethodEngineInterface*> | |
209 EngineMap; | |
210 typedef std::map<Profile*, EngineMap, ProfileCompare> ProfileEngineMap; | |
211 ProfileEngineMap profile_engine_map_; | |
212 | 206 |
213 DISALLOW_COPY_AND_ASSIGN(InputMethodManagerImpl); | 207 DISALLOW_COPY_AND_ASSIGN(InputMethodManagerImpl); |
214 }; | 208 }; |
215 | 209 |
216 } // namespace input_method | 210 } // namespace input_method |
217 } // namespace chromeos | 211 } // namespace chromeos |
218 | 212 |
219 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_H_ | 213 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_H_ |
OLD | NEW |