#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"
class InputMethodEngine;
namespace input_method {
class InputMethodDelegate;
-class XKeyboard;
+class ImeKeyboard;
// The implementation of InputMethodManager.
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.
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;
// 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);
// (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.
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.
// 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_;
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);
};