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

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

Issue 1136463005: Supports multiple profile in Chrome OS IMF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased. Created 5 years, 7 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 7acb6f1a6a8bb452fb0ccf58169811f9a1a2d91a..30fb3be0d6738894033aaa3e166c5e1ffedcae7a 100644
--- a/chrome/browser/extensions/api/input_ime/input_ime_api.h
+++ b/chrome/browser/extensions/api/input_ime/input_ime_api.h
@@ -34,10 +34,10 @@ struct InputComponentInfo;
class InputImeEventRouter {
public:
- static InputImeEventRouter* GetInstance();
+ explicit InputImeEventRouter(Profile* profile);
+ ~InputImeEventRouter();
bool RegisterImeExtension(
- Profile* profile,
const std::string& extension_id,
const std::vector<extensions::InputComponentInfo>& input_components);
void UnregisterAllImes(const std::string& extension_id);
@@ -58,22 +58,34 @@ class InputImeEventRouter {
chromeos::input_method::KeyEventHandle* key_data);
private:
- friend struct DefaultSingletonTraits<InputImeEventRouter>;
typedef std::map<std::string, std::pair<std::string,
chromeos::input_method::KeyEventHandle*> > RequestMap;
- InputImeEventRouter();
- ~InputImeEventRouter();
-
// The engine map from extension_id to an engine.
std::map<std::string, chromeos::InputMethodEngineInterface*> engine_map_;
unsigned int next_request_id_;
RequestMap request_map_;
+ Profile* profile_;
DISALLOW_COPY_AND_ASSIGN(InputImeEventRouter);
};
+class InputImeEventRouterFactory {
+ public:
+ static InputImeEventRouterFactory* GetInstance();
+ InputImeEventRouter* GetRouter(Profile* profile);
+
+ private:
+ friend struct DefaultSingletonTraits<InputImeEventRouterFactory>;
+ InputImeEventRouterFactory();
+ ~InputImeEventRouterFactory();
+
+ std::map<Profile*, InputImeEventRouter*, ProfileCompare> router_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(InputImeEventRouterFactory);
+};
+
class InputImeSetCompositionFunction : public SyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("input.ime.setComposition",

Powered by Google App Engine
This is Rietveld 408576698