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

Side by Side Diff: chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h

Issue 1554983002: Build chrome.input.ime.* API in GN mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove class InputImeEventRouter from input_ime_api.h to input_ime_api_chromeos/nonchromeos.h Created 4 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_
7 7
8 #include "extensions/browser/extension_function.h" 8 #include "extensions/browser/extension_function.h"
9 9
10 namespace extensions { 10 namespace extensions {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 DECLARE_EXTENSION_FUNCTION("input.ime.hideInputView", 131 DECLARE_EXTENSION_FUNCTION("input.ime.hideInputView",
132 INPUT_IME_HIDEINPUTVIEW) 132 INPUT_IME_HIDEINPUTVIEW)
133 133
134 protected: 134 protected:
135 ~InputImeHideInputViewFunction() override {} 135 ~InputImeHideInputViewFunction() override {}
136 136
137 // ExtensionFunction: 137 // ExtensionFunction:
138 bool RunAsync() override; 138 bool RunAsync() override;
139 }; 139 };
140 140
141 class ExtensionRegistry;
142 struct InputComponentInfo;
143
144 class InputImeEventRouter {
145 public:
146 explicit InputImeEventRouter(Profile* profile);
147 ~InputImeEventRouter();
148
149 bool RegisterImeExtension(
150 const std::string& extension_id,
151 const std::vector<extensions::InputComponentInfo>& input_components);
152 void UnregisterAllImes(const std::string& extension_id);
153
154 ui::IMEEngineHandlerInterface* GetEngine(const std::string& extension_id,
155 const std::string& component_id);
156 ui::IMEEngineHandlerInterface* GetActiveEngine(
157 const std::string& extension_id);
158
159 // Called when a key event was handled.
160 void OnKeyEventHandled(const std::string& extension_id,
161 const std::string& request_id,
162 bool handled);
163
164 std::string AddRequest(
Shu Chen 2016/01/05 15:10:48 I think AddRequest() and the request map logics ca
Devlin 2016/01/05 18:39:06 +1. The goal is to have these platform-specific f
Azure Wei 2016/01/06 06:53:47 Done. Added class InputImeEventRouterBase.
Azure Wei 2016/01/06 06:53:47 Done.
165 const std::string& component_id,
166 ui::IMEEngineHandlerInterface::KeyEventDoneCallback& key_data);
167
168 private:
169 typedef std::map<
170 std::string,
171 std::pair<std::string,
172 ui::IMEEngineHandlerInterface::KeyEventDoneCallback>>
173 RequestMap;
174
175 // The engine map from extension_id to an engine.
176 std::map<std::string, ui::IMEEngineHandlerInterface*> engine_map_;
177
178 unsigned int next_request_id_;
179 RequestMap request_map_;
180 Profile* profile_;
181
182 DISALLOW_COPY_AND_ASSIGN(InputImeEventRouter);
183 };
184
141 } // namespace extensions 185 } // namespace extensions
142 186
143 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ 187 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698