#ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_
#define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_
#include "chrome/browser/chromeos/input_method/input_method_util.h"
#include "chromeos/ime/fake_input_method_delegate.h"
#include "chromeos/ime/fake_xkeyboard.h"
#include "chromeos/ime/input_method_manager.h"
#include "chromeos/ime/input_method_whitelist.h"
namespace chromeos {
namespace input_method {
class MockInputMethodManager : public InputMethodManager {
public:
MockInputMethodManager();
virtual ~MockInputMethodManager();
virtual void AddObserver(InputMethodManager::Observer* observer) OVERRIDE;
virtual void AddCandidateWindowObserver(
InputMethodManager::CandidateWindowObserver* observer) OVERRIDE;
virtual void RemoveObserver(InputMethodManager::Observer* observer) OVERRIDE;
virtual void RemoveCandidateWindowObserver(
InputMethodManager::CandidateWindowObserver* observer) OVERRIDE;
virtual scoped_ptr<InputMethodDescriptors>
GetSupportedInputMethods() const OVERRIDE;
virtual scoped_ptr<InputMethodDescriptors>
GetActiveInputMethods() const OVERRIDE;
virtual const std::vector<std::string>& GetActiveInputMethodIds() const
OVERRIDE;
virtual size_t GetNumActiveInputMethods() const OVERRIDE;
virtual const InputMethodDescriptor* GetInputMethodFromId(
const std::string& input_method_id) const OVERRIDE;
virtual void EnableLoginLayouts(
const std::string& language_code,
const std::vector<std::string>& initial_layout) OVERRIDE;
virtual bool ReplaceEnabledInputMethods(
const std::vector<std::string>& new_active_input_method_ids) OVERRIDE;
virtual bool EnableInputMethod(
const std::string& new_active_input_method_id) OVERRIDE;
virtual void ChangeInputMethod(const std::string& input_method_id) OVERRIDE;
virtual void ActivateInputMethodMenuItem(const std::string& key) OVERRIDE;
virtual void AddInputMethodExtension(
const std::string& id,
InputMethodEngineInterface* instance) OVERRIDE;
virtual void RemoveInputMethodExtension(const std::string& id) OVERRIDE;
virtual void GetInputMethodExtensions(
InputMethodDescriptors* result) OVERRIDE;
virtual void SetEnabledExtensionImes(std::vector<std::string>* ids) OVERRIDE;
virtual void SetInputMethodLoginDefault() OVERRIDE;
virtual bool SwitchToNextInputMethod() OVERRIDE;
virtual bool SwitchToPreviousInputMethod(
const ui::Accelerator& accelerator) OVERRIDE;
virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) OVERRIDE;
virtual InputMethodDescriptor GetCurrentInputMethod() const OVERRIDE;
virtual bool IsISOLevel5ShiftUsedByCurrentInputMethod() const OVERRIDE;
virtual bool IsAltGrUsedByCurrentInputMethod() const OVERRIDE;
virtual XKeyboard* GetXKeyboard() OVERRIDE;
virtual InputMethodUtil* GetInputMethodUtil() OVERRIDE;
virtual ComponentExtensionIMEManager*
GetComponentExtensionIMEManager() OVERRIDE;
virtual bool IsLoginKeyboard(const std::string& layout) const OVERRIDE;
virtual bool MigrateXkbInputMethods(
std::vector<std::string>* input_method_ids) OVERRIDE;
void SetCurrentInputMethodId(const std::string& input_method_id) {
current_input_method_id_ = input_method_id;
}
void set_application_locale(const std::string& value);
void set_mod3_used(bool value) { mod3_used_ = value; }
int add_observer_count_;
int remove_observer_count_;
private:
std::string current_input_method_id_;
InputMethodWhitelist whitelist_;
FakeInputMethodDelegate delegate_;
InputMethodUtil util_;
FakeXKeyboard xkeyboard_;
bool mod3_used_;
std::vector<std::string> active_input_method_ids_;
DISALLOW_COPY_AND_ASSIGN(MockInputMethodManager);
};
}
}
#endif