Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / input_method / input_method_manager_impl.h
index 23ec79c..d357c29 100644 (file)
@@ -14,6 +14,7 @@
 #include "base/threading/thread_checker.h"
 #include "chrome/browser/chromeos/input_method/candidate_window_controller.h"
 #include "chrome/browser/chromeos/input_method/input_method_util.h"
+#include "chrome/browser/profiles/profile.h"
 #include "chromeos/ime/input_method_manager.h"
 #include "chromeos/ime/input_method_whitelist.h"
 
@@ -23,7 +24,7 @@ class ComponentExtensionIMEManagerDelegate;
 class InputMethodEngine;
 namespace input_method {
 class InputMethodDelegate;
-class XKeyboard;
+class ImeKeyboard;
 
 // The implementation of InputMethodManager.
 class InputMethodManagerImpl : public InputMethodManager,
@@ -34,7 +35,7 @@ class InputMethodManagerImpl : public InputMethodManager,
   explicit InputMethodManagerImpl(scoped_ptr<InputMethodDelegate> delegate);
   virtual ~InputMethodManagerImpl();
 
-  // Attach CandidateWindowController, and XKeyboard objects to the
+  // Attach CandidateWindowController, and ImeKeyboard objects to the
   // InputMethodManagerImpl object. You don't have to call this
   // function if you attach them yourself (e.g. in unit tests) using
   // the protected setters.
@@ -84,7 +85,7 @@ class InputMethodManagerImpl : public InputMethodManager,
   virtual bool IsISOLevel5ShiftUsedByCurrentInputMethod() const OVERRIDE;
   virtual bool IsAltGrUsedByCurrentInputMethod() const OVERRIDE;
 
-  virtual XKeyboard* GetXKeyboard() OVERRIDE;
+  virtual ImeKeyboard* GetImeKeyboard() OVERRIDE;
   virtual InputMethodUtil* GetInputMethodUtil() OVERRIDE;
   virtual ComponentExtensionIMEManager*
       GetComponentExtensionIMEManager() OVERRIDE;
@@ -96,8 +97,8 @@ class InputMethodManagerImpl : public InputMethodManager,
   // Sets |candidate_window_controller_|.
   void SetCandidateWindowControllerForTesting(
       CandidateWindowController* candidate_window_controller);
-  // Sets |xkeyboard_|.
-  void SetXKeyboardForTesting(XKeyboard* xkeyboard);
+  // Sets |keyboard_|.
+  void SetImeKeyboardForTesting(ImeKeyboard* keyboard);
   // Initialize |component_extension_manager_|.
   void InitializeComponentExtensionForTesting(
       scoped_ptr<ComponentExtensionIMEManagerDelegate> delegate);
@@ -159,6 +160,9 @@ class InputMethodManagerImpl : public InputMethodManager,
   // (after list of enabled input methods has been updated)
   void ReconfigureIMFramework();
 
+  // Gets the current active user profile.
+  Profile* GetProfile() const;
+
   scoped_ptr<InputMethodDelegate> delegate_;
 
   // The current browser status.
@@ -196,7 +200,7 @@ class InputMethodManagerImpl : public InputMethodManager,
   InputMethodWhitelist whitelist_;
 
   // An object which provides miscellaneous input method utility functions. Note
-  // that |util_| is required to initialize |xkeyboard_|.
+  // that |util_| is required to initialize |keyboard_|.
   InputMethodUtil util_;
 
   // An object which provides component extension ime management functions.
@@ -204,7 +208,7 @@ class InputMethodManagerImpl : public InputMethodManager,
 
   // An object for switching XKB layouts and keyboard status like caps lock and
   // auto-repeat interval.
-  scoped_ptr<XKeyboard> xkeyboard_;
+  scoped_ptr<ImeKeyboard> keyboard_;
 
   std::string pending_input_method_;
 
@@ -212,6 +216,13 @@ class InputMethodManagerImpl : public InputMethodManager,
 
   base::WeakPtrFactory<InputMethodManagerImpl> weak_ptr_factory_;
 
+  // The engine map:
+  //   { Profile : { input_method_id : Engine } }.
+  typedef std::map<std::string, InputMethodEngineInterface*>
+      EngineMap;
+  typedef std::map<Profile*, EngineMap, ProfileCompare> ProfileEngineMap;
+  ProfileEngineMap profile_engine_map_;
+
   DISALLOW_COPY_AND_ASSIGN(InputMethodManagerImpl);
 };