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

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

Issue 433163005: Refactoring for InputMethodEngine and InputMethodEventRouter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed browser_tests: ExtensionApiTest.InputImeApiBasic Created 6 years, 4 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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& extension_id,
69 const std::string& id, 69 const InputMethodDescriptors& descriptors,
70 InputMethodEngineInterface* instance) OVERRIDE; 70 InputMethodEngineInterface* instance) OVERRIDE;
71 virtual void RemoveInputMethodExtension(Profile* profile, 71 virtual void RemoveInputMethodExtension(
72 const std::string& id) OVERRIDE; 72 const std::string& extension_id) OVERRIDE;
73 virtual void GetInputMethodExtensions( 73 virtual void GetInputMethodExtensions(
74 InputMethodDescriptors* result) OVERRIDE; 74 InputMethodDescriptors* result) OVERRIDE;
75 virtual void SetEnabledExtensionImes(std::vector<std::string>* ids) OVERRIDE; 75 virtual void SetEnabledExtensionImes(std::vector<std::string>* ids) OVERRIDE;
76 virtual void SetInputMethodLoginDefault() OVERRIDE; 76 virtual void SetInputMethodLoginDefault() OVERRIDE;
77 virtual void SetInputMethodLoginDefaultFromVPD( 77 virtual void SetInputMethodLoginDefaultFromVPD(
78 const std::string& locale, const std::string& layout) OVERRIDE; 78 const std::string& locale, const std::string& layout) OVERRIDE;
79 virtual bool SwitchToNextInputMethod() OVERRIDE; 79 virtual bool SwitchToNextInputMethod() OVERRIDE;
80 virtual bool SwitchToPreviousInputMethod( 80 virtual bool SwitchToPreviousInputMethod(
81 const ui::Accelerator& accelerator) OVERRIDE; 81 const ui::Accelerator& accelerator) OVERRIDE;
82 virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) OVERRIDE; 82 virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) OVERRIDE;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 // Adds new input method to given list if possible 150 // Adds new input method to given list if possible
151 bool EnableInputMethodImpl( 151 bool EnableInputMethodImpl(
152 const std::string& input_method_id, 152 const std::string& input_method_id,
153 std::vector<std::string>* new_active_input_method_ids) const; 153 std::vector<std::string>* new_active_input_method_ids) const;
154 154
155 // Starts or stops the system input method framework as needed. 155 // Starts or stops the system input method framework as needed.
156 // (after list of enabled input methods has been updated) 156 // (after list of enabled input methods has been updated)
157 void ReconfigureIMFramework(); 157 void ReconfigureIMFramework();
158 158
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!
163 Profile* GetProfile() const;
164
165 scoped_ptr<InputMethodDelegate> delegate_; 159 scoped_ptr<InputMethodDelegate> delegate_;
166 160
167 // The current browser status. 161 // The current browser status.
168 State state_; 162 State state_;
169 163
170 // A list of objects that monitor the manager. 164 // A list of objects that monitor the manager.
171 ObserverList<InputMethodManager::Observer> observers_; 165 ObserverList<InputMethodManager::Observer> observers_;
172 ObserverList<CandidateWindowObserver> candidate_window_observers_; 166 ObserverList<CandidateWindowObserver> candidate_window_observers_;
173 167
174 // The input method which was/is selected. 168 // The input method which was/is selected.
(...skipping 26 matching lines...) Expand all
201 195
202 // An object which provides component extension ime management functions. 196 // An object which provides component extension ime management functions.
203 scoped_ptr<ComponentExtensionIMEManager> component_extension_ime_manager_; 197 scoped_ptr<ComponentExtensionIMEManager> component_extension_ime_manager_;
204 198
205 // An object for switching XKB layouts and keyboard status like caps lock and 199 // An object for switching XKB layouts and keyboard status like caps lock and
206 // auto-repeat interval. 200 // auto-repeat interval.
207 scoped_ptr<ImeKeyboard> keyboard_; 201 scoped_ptr<ImeKeyboard> keyboard_;
208 202
209 base::ThreadChecker thread_checker_; 203 base::ThreadChecker thread_checker_;
210 204
211 base::WeakPtrFactory<InputMethodManagerImpl> weak_ptr_factory_; 205 base::WeakPtrFactory<InputMethodManagerImpl> weak_ptr_factory_;
Alexander Alekseev 2014/08/06 20:48:28 This should be the last member.
Shu Chen 2014/08/07 00:44:28 I don't see any code is using it. Probably it shou
212 206
213 // The engine map: 207 // The engine map from extension_id to an engine.
214 // { Profile : { input_method_id : Engine } }. 208 std::map<std::string, InputMethodEngineInterface*> engine_map_;
215 typedef std::map<std::string, InputMethodEngineInterface*>
216 EngineMap;
217 typedef std::map<Profile*, EngineMap, ProfileCompare> ProfileEngineMap;
218 ProfileEngineMap profile_engine_map_;
219 209
220 DISALLOW_COPY_AND_ASSIGN(InputMethodManagerImpl); 210 DISALLOW_COPY_AND_ASSIGN(InputMethodManagerImpl);
221 }; 211 };
222 212
223 } // namespace input_method 213 } // namespace input_method
224 } // namespace chromeos 214 } // namespace chromeos
225 215
226 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_H_ 216 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698