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

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

Issue 389913002: Moving IME manifests to chrome resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: modified per comments. Created 6 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_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 17 matching lines...) Expand all
28 28
29 // The implementation of InputMethodManager. 29 // The implementation of InputMethodManager.
30 class InputMethodManagerImpl : public InputMethodManager, 30 class InputMethodManagerImpl : public InputMethodManager,
31 public CandidateWindowController::Observer { 31 public CandidateWindowController::Observer {
32 public: 32 public:
33 // Constructs an InputMethodManager instance. The client is responsible for 33 // Constructs an InputMethodManager instance. The client is responsible for
34 // calling |SetState| in response to relevant changes in browser state. 34 // calling |SetState| in response to relevant changes in browser state.
35 explicit InputMethodManagerImpl(scoped_ptr<InputMethodDelegate> delegate); 35 explicit InputMethodManagerImpl(scoped_ptr<InputMethodDelegate> delegate);
36 virtual ~InputMethodManagerImpl(); 36 virtual ~InputMethodManagerImpl();
37 37
38 // Attach CandidateWindowController, and ImeKeyboard objects to the
39 // InputMethodManagerImpl object. You don't have to call this
40 // function if you attach them yourself (e.g. in unit tests) using
41 // the protected setters.
42 void Init(base::SequencedTaskRunner* ui_task_runner);
43
44 // Receives notification of an InputMethodManager::State transition. 38 // Receives notification of an InputMethodManager::State transition.
45 void SetState(State new_state); 39 void SetState(State new_state);
46 40
47 // InputMethodManager override: 41 // InputMethodManager override:
42 virtual void InitializeComponentExtension() OVERRIDE;
48 virtual void AddObserver(InputMethodManager::Observer* observer) OVERRIDE; 43 virtual void AddObserver(InputMethodManager::Observer* observer) OVERRIDE;
49 virtual void AddCandidateWindowObserver( 44 virtual void AddCandidateWindowObserver(
50 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; 45 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE;
51 virtual void RemoveObserver(InputMethodManager::Observer* observer) OVERRIDE; 46 virtual void RemoveObserver(InputMethodManager::Observer* observer) OVERRIDE;
52 virtual void RemoveCandidateWindowObserver( 47 virtual void RemoveCandidateWindowObserver(
53 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; 48 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE;
54 virtual scoped_ptr<InputMethodDescriptors> 49 virtual scoped_ptr<InputMethodDescriptors>
55 GetSupportedInputMethods() const OVERRIDE; 50 GetSupportedInputMethods() const OVERRIDE;
56 virtual scoped_ptr<InputMethodDescriptors> 51 virtual scoped_ptr<InputMethodDescriptors>
57 GetActiveInputMethods() const OVERRIDE; 52 GetActiveInputMethods() const OVERRIDE;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // input_method_ids[N+1]. 132 // input_method_ids[N+1].
138 void SwitchToNextInputMethodInternal( 133 void SwitchToNextInputMethodInternal(
139 const std::vector<std::string>& input_method_ids, 134 const std::vector<std::string>& input_method_ids,
140 const std::string& current_input_method_id); 135 const std::string& current_input_method_id);
141 136
142 // Change system input method. 137 // Change system input method.
143 // Returns true if the system input method is changed. 138 // Returns true if the system input method is changed.
144 bool ChangeInputMethodInternal(const std::string& input_method_id, 139 bool ChangeInputMethodInternal(const std::string& input_method_id,
145 bool show_message); 140 bool show_message);
146 141
147 // Gets whether the XKB extension is loaded successfully by checking the XKB
148 // input methods in input methods in |component_extension_ime_manager_|.
149 bool IsXkbComponentExtensionAvailable() const;
150
151 // Called when the ComponentExtensionIMEManagerDelegate is initialized.
152 void OnComponentExtensionInitialized(
153 scoped_ptr<ComponentExtensionIMEManagerDelegate> delegate);
154 void InitializeComponentExtension();
155
156 // Loads necessary component extensions. 142 // Loads necessary component extensions.
157 // TODO(nona): Support dynamical unloading. 143 // TODO(nona): Support dynamical unloading.
158 void LoadNecessaryComponentExtensions(); 144 void LoadNecessaryComponentExtensions();
159 145
160 // Adds new input method to given list if possible 146 // Adds new input method to given list if possible
161 bool EnableInputMethodImpl( 147 bool EnableInputMethodImpl(
162 const std::string& input_method_id, 148 const std::string& input_method_id,
163 std::vector<std::string>* new_active_input_method_ids) const; 149 std::vector<std::string>* new_active_input_method_ids) const;
164 150
165 // Starts or stops the system input method framework as needed. 151 // Starts or stops the system input method framework as needed.
(...skipping 29 matching lines...) Expand all
195 std::vector<std::string> saved_active_input_method_ids_; 181 std::vector<std::string> saved_active_input_method_ids_;
196 182
197 // Extra input methods that have been explicitly added to the menu, such as 183 // Extra input methods that have been explicitly added to the menu, such as
198 // those created by extension. 184 // those created by extension.
199 std::map<std::string, InputMethodDescriptor> extra_input_methods_; 185 std::map<std::string, InputMethodDescriptor> extra_input_methods_;
200 186
201 // The candidate window. This will be deleted when the APP_TERMINATING 187 // The candidate window. This will be deleted when the APP_TERMINATING
202 // message is sent. 188 // message is sent.
203 scoped_ptr<CandidateWindowController> candidate_window_controller_; 189 scoped_ptr<CandidateWindowController> candidate_window_controller_;
204 190
205 // The object which can create an InputMethodDescriptor object.
206 InputMethodWhitelist whitelist_;
207
208 // An object which provides miscellaneous input method utility functions. Note 191 // An object which provides miscellaneous input method utility functions. Note
209 // that |util_| is required to initialize |keyboard_|. 192 // that |util_| is required to initialize |keyboard_|.
210 InputMethodUtil util_; 193 InputMethodUtil util_;
211 194
212 // An object which provides component extension ime management functions. 195 // An object which provides component extension ime management functions.
213 scoped_ptr<ComponentExtensionIMEManager> component_extension_ime_manager_; 196 scoped_ptr<ComponentExtensionIMEManager> component_extension_ime_manager_;
214 197
215 // An object for switching XKB layouts and keyboard status like caps lock and 198 // An object for switching XKB layouts and keyboard status like caps lock and
216 // auto-repeat interval. 199 // auto-repeat interval.
217 scoped_ptr<ImeKeyboard> keyboard_; 200 scoped_ptr<ImeKeyboard> keyboard_;
218 201
219 std::string pending_input_method_;
220
221 base::ThreadChecker thread_checker_; 202 base::ThreadChecker thread_checker_;
222 203
223 base::WeakPtrFactory<InputMethodManagerImpl> weak_ptr_factory_; 204 base::WeakPtrFactory<InputMethodManagerImpl> weak_ptr_factory_;
224 205
225 // The engine map: 206 // The engine map:
226 // { Profile : { input_method_id : Engine } }. 207 // { Profile : { input_method_id : Engine } }.
227 typedef std::map<std::string, InputMethodEngineInterface*> 208 typedef std::map<std::string, InputMethodEngineInterface*>
228 EngineMap; 209 EngineMap;
229 typedef std::map<Profile*, EngineMap, ProfileCompare> ProfileEngineMap; 210 typedef std::map<Profile*, EngineMap, ProfileCompare> ProfileEngineMap;
230 ProfileEngineMap profile_engine_map_; 211 ProfileEngineMap profile_engine_map_;
231 212
232 DISALLOW_COPY_AND_ASSIGN(InputMethodManagerImpl); 213 DISALLOW_COPY_AND_ASSIGN(InputMethodManagerImpl);
233 }; 214 };
234 215
235 } // namespace input_method 216 } // namespace input_method
236 } // namespace chromeos 217 } // namespace chromeos
237 218
238 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_H_ 219 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698