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

Unified Diff: chrome/browser/extensions/api/input_ime/input_ime_api.h

Issue 433163005: Refactoring for InputMethodEngine and InputMethodEventRouter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: error tolerance for missing background page for key events. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/input_ime/input_ime_api.h
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.h b/chrome/browser/extensions/api/input_ime/input_ime_api.h
index 0090e5d0f8df56efb35bdd4b539c66203541d6f6..889504d78ed38f06dadfafd89d5d3f9cf72a6dd9 100644
--- a/chrome/browser/extensions/api/input_ime/input_ime_api.h
+++ b/chrome/browser/extensions/api/input_ime/input_ime_api.h
@@ -36,13 +36,14 @@ class InputImeEventRouter {
public:
static InputImeEventRouter* GetInstance();
- bool RegisterIme(Profile*,
- const std::string& extension_id,
- const extensions::InputComponentInfo& component);
+ bool RegisterImeExtension(
+ const std::string& extension_id,
+ const std::vector<extensions::InputComponentInfo>& input_components);
void UnregisterAllImes(const std::string& extension_id);
+
chromeos::InputMethodEngineInterface* GetEngine(
const std::string& extension_id,
- const std::string& engine_id);
+ const std::string& component_id);
chromeos::InputMethodEngineInterface* GetActiveEngine(
const std::string& extension_id);
@@ -52,7 +53,7 @@ class InputImeEventRouter {
const std::string& request_id,
bool handled);
- std::string AddRequest(const std::string& engine_id,
+ std::string AddRequest(const std::string& component_id,
chromeos::input_method::KeyEventHandle* key_data);
private:
@@ -63,15 +64,7 @@ class InputImeEventRouter {
InputImeEventRouter();
~InputImeEventRouter();
- // The engine map for event routing.
- // { Profile : { extension_id : { engine_id : Engine } } }.
- // TODO(shuchen): reuse the engine map in InputMethodManagerImpl.
- typedef std::map<std::string, chromeos::InputMethodEngineInterface*>
- EngineMap;
- typedef std::map<std::string, EngineMap> ExtensionMap;
- typedef std::map<Profile*, ExtensionMap, ProfileCompare>
- ProfileEngineMap;
- ProfileEngineMap profile_engine_map_;
+ std::map<std::string, chromeos::InputMethodEngineInterface*> engine_map_;
Yuki 2014/08/06 04:42:24 Better to have a comment here, too. Say that the k
Shu Chen 2014/08/06 05:45:03 Done.
unsigned int next_request_id_;
RequestMap request_map_;

Powered by Google App Engine
This is Rietveld 408576698