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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 virtual size_t GetNumActiveInputMethods() const OVERRIDE; | 59 virtual size_t GetNumActiveInputMethods() const OVERRIDE; |
60 virtual const InputMethodDescriptor* GetInputMethodFromId( | 60 virtual const InputMethodDescriptor* GetInputMethodFromId( |
61 const std::string& input_method_id) const OVERRIDE; | 61 const std::string& input_method_id) const OVERRIDE; |
62 virtual void EnableLoginLayouts(const std::string& language_code, | 62 virtual void EnableLoginLayouts(const std::string& language_code, |
63 const std::string& initial_layout) OVERRIDE; | 63 const std::string& initial_layout) OVERRIDE; |
64 virtual bool EnableInputMethods( | 64 virtual bool EnableInputMethods( |
65 const std::vector<std::string>& new_active_input_method_ids) OVERRIDE; | 65 const std::vector<std::string>& new_active_input_method_ids) OVERRIDE; |
66 virtual bool EnableInputMethod(const std::string& new_active_input_method_id) | 66 virtual bool EnableInputMethod(const std::string& new_active_input_method_id) |
67 OVERRIDE; | 67 OVERRIDE; |
68 virtual void ChangeInputMethod(const std::string& input_method_id) OVERRIDE; | 68 virtual void ChangeInputMethod(const std::string& input_method_id) OVERRIDE; |
69 virtual void ActivateInputMethodMenuItem(const std::string& key) OVERRIDE; | 69 virtual void ActivateInputMethodProperty(const std::string& key) OVERRIDE; |
70 virtual void AddInputMethodExtension( | 70 virtual void AddInputMethodExtension( |
71 const std::string& id, | 71 const std::string& id, |
72 InputMethodEngineInterface* instance) OVERRIDE; | 72 InputMethodEngineInterface* instance) OVERRIDE; |
73 virtual void RemoveInputMethodExtension(const std::string& id) OVERRIDE; | 73 virtual void RemoveInputMethodExtension(const std::string& id) OVERRIDE; |
74 virtual void GetInputMethodExtensions( | 74 virtual void GetInputMethodExtensions( |
75 InputMethodDescriptors* result) OVERRIDE; | 75 InputMethodDescriptors* result) OVERRIDE; |
76 virtual void SetEnabledExtensionImes(std::vector<std::string>* ids) OVERRIDE; | 76 virtual void SetEnabledExtensionImes(std::vector<std::string>* ids) OVERRIDE; |
77 virtual void SetInputMethodDefault() OVERRIDE; | 77 virtual void SetInputMethodDefault() OVERRIDE; |
78 virtual bool SwitchToNextInputMethod() OVERRIDE; | 78 virtual bool SwitchToNextInputMethod() OVERRIDE; |
79 virtual bool SwitchToPreviousInputMethod( | 79 virtual bool SwitchToPreviousInputMethod( |
80 const ui::Accelerator& accelerator) OVERRIDE; | 80 const ui::Accelerator& accelerator) OVERRIDE; |
81 virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) OVERRIDE; | 81 virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) OVERRIDE; |
82 virtual InputMethodDescriptor GetCurrentInputMethod() const OVERRIDE; | 82 virtual InputMethodDescriptor GetCurrentInputMethod() const OVERRIDE; |
| 83 virtual InputMethodPropertyList |
| 84 GetCurrentInputMethodProperties() const OVERRIDE; |
| 85 virtual void SetCurrentInputMethodProperties( |
| 86 const InputMethodPropertyList& property_list) OVERRIDE; |
83 | 87 |
84 virtual XKeyboard* GetXKeyboard() OVERRIDE; | 88 virtual XKeyboard* GetXKeyboard() OVERRIDE; |
85 virtual InputMethodUtil* GetInputMethodUtil() OVERRIDE; | 89 virtual InputMethodUtil* GetInputMethodUtil() OVERRIDE; |
86 virtual ComponentExtensionIMEManager* | 90 virtual ComponentExtensionIMEManager* |
87 GetComponentExtensionIMEManager() OVERRIDE; | 91 GetComponentExtensionIMEManager() OVERRIDE; |
88 virtual bool IsLoginKeyboard(const std::string& layout) const OVERRIDE; | 92 virtual bool IsLoginKeyboard(const std::string& layout) const OVERRIDE; |
89 | 93 |
90 // Sets |candidate_window_controller_|. | 94 // Sets |candidate_window_controller_|. |
91 void SetCandidateWindowControllerForTesting( | 95 void SetCandidateWindowControllerForTesting( |
92 CandidateWindowController* candidate_window_controller); | 96 CandidateWindowController* candidate_window_controller); |
93 // Sets |xkeyboard_|. | 97 // Sets |xkeyboard_|. |
94 void SetXKeyboardForTesting(XKeyboard* xkeyboard); | 98 void SetXKeyboardForTesting(XKeyboard* xkeyboard); |
95 // Initialize |component_extension_manager_|. | 99 // Initialize |component_extension_manager_|. |
96 void InitializeComponentExtensionForTesting( | 100 void InitializeComponentExtensionForTesting( |
97 scoped_ptr<ComponentExtensionIMEManagerDelegate> delegate); | 101 scoped_ptr<ComponentExtensionIMEManagerDelegate> delegate); |
98 | 102 |
99 private: | 103 private: |
| 104 // Notifies observers that the property list is updated. |
| 105 void PropertyChanged(); |
| 106 |
100 // CandidateWindowController::Observer overrides: | 107 // CandidateWindowController::Observer overrides: |
101 virtual void CandidateClicked(int index) OVERRIDE; | 108 virtual void CandidateClicked(int index) OVERRIDE; |
102 virtual void CandidateWindowOpened() OVERRIDE; | 109 virtual void CandidateWindowOpened() OVERRIDE; |
103 virtual void CandidateWindowClosed() OVERRIDE; | 110 virtual void CandidateWindowClosed() OVERRIDE; |
104 | 111 |
105 // Temporarily deactivates all input methods (e.g. Chinese, Japanese, Arabic) | 112 // Temporarily deactivates all input methods (e.g. Chinese, Japanese, Arabic) |
106 // since they are not necessary to input a login password. Users are still | 113 // since they are not necessary to input a login password. Users are still |
107 // able to use/switch active keyboard layouts (e.g. US qwerty, US dvorak, | 114 // able to use/switch active keyboard layouts (e.g. US qwerty, US dvorak, |
108 // French). | 115 // French). |
109 void OnScreenLocked(); | 116 void OnScreenLocked(); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // |current_input_method_|, and |active_input_method_ids_| above are copied | 182 // |current_input_method_|, and |active_input_method_ids_| above are copied |
176 // to these "saved" variables. | 183 // to these "saved" variables. |
177 InputMethodDescriptor saved_previous_input_method_; | 184 InputMethodDescriptor saved_previous_input_method_; |
178 InputMethodDescriptor saved_current_input_method_; | 185 InputMethodDescriptor saved_current_input_method_; |
179 std::vector<std::string> saved_active_input_method_ids_; | 186 std::vector<std::string> saved_active_input_method_ids_; |
180 | 187 |
181 // Extra input methods that have been explicitly added to the menu, such as | 188 // Extra input methods that have been explicitly added to the menu, such as |
182 // those created by extension. | 189 // those created by extension. |
183 std::map<std::string, InputMethodDescriptor> extra_input_methods_; | 190 std::map<std::string, InputMethodDescriptor> extra_input_methods_; |
184 | 191 |
| 192 // Property list of the input method. This is set by extension IMEs. |
| 193 InputMethodPropertyList property_list_; |
| 194 |
185 // The candidate window. This will be deleted when the APP_TERMINATING | 195 // The candidate window. This will be deleted when the APP_TERMINATING |
186 // message is sent. | 196 // message is sent. |
187 scoped_ptr<CandidateWindowController> candidate_window_controller_; | 197 scoped_ptr<CandidateWindowController> candidate_window_controller_; |
188 | 198 |
189 // The object which can create an InputMethodDescriptor object. | 199 // The object which can create an InputMethodDescriptor object. |
190 InputMethodWhitelist whitelist_; | 200 InputMethodWhitelist whitelist_; |
191 | 201 |
192 // An object which provides miscellaneous input method utility functions. Note | 202 // An object which provides miscellaneous input method utility functions. Note |
193 // that |util_| is required to initialize |xkeyboard_|. | 203 // that |util_| is required to initialize |xkeyboard_|. |
194 InputMethodUtil util_; | 204 InputMethodUtil util_; |
(...skipping 11 matching lines...) Expand all Loading... |
206 | 216 |
207 base::WeakPtrFactory<InputMethodManagerImpl> weak_ptr_factory_; | 217 base::WeakPtrFactory<InputMethodManagerImpl> weak_ptr_factory_; |
208 | 218 |
209 DISALLOW_COPY_AND_ASSIGN(InputMethodManagerImpl); | 219 DISALLOW_COPY_AND_ASSIGN(InputMethodManagerImpl); |
210 }; | 220 }; |
211 | 221 |
212 } // namespace input_method | 222 } // namespace input_method |
213 } // namespace chromeos | 223 } // namespace chromeos |
214 | 224 |
215 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_H_ | 225 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_H_ |
OLD | NEW |