#include "ui/base/ime/mock_input_method.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/observer_list.h"
#include "build/build_config.h"
#include "ui/base/ime/ime_key_event_dispatcher.h"
#include "ui/base/ime/text_input_client.h"
#include "ui/events/event.h"
#if BUILDFLAG(IS_WIN)
#include <windows.h>
#endif
namespace ui {
MockInputMethod::MockInputMethod(
ImeKeyEventDispatcher* ime_key_event_dispatcher)
: … { … }
MockInputMethod::~MockInputMethod() { … }
void MockInputMethod::SetImeKeyEventDispatcher(
ImeKeyEventDispatcher* ime_key_event_dispatcher) { … }
void MockInputMethod::SetFocusedTextInputClient(TextInputClient* client) { … }
void MockInputMethod::DetachTextInputClient(TextInputClient* client) { … }
TextInputClient* MockInputMethod::GetTextInputClient() const { … }
ui::EventDispatchDetails MockInputMethod::DispatchKeyEvent(
ui::KeyEvent* event) { … }
void MockInputMethod::OnFocus() { … }
void MockInputMethod::OnBlur() { … }
#if BUILDFLAG(IS_WIN)
bool MockInputMethod::OnUntranslatedIMEMessage(const CHROME_MSG event,
NativeEventResult* result) {
if (result)
*result = NativeEventResult();
return false;
}
void MockInputMethod::OnInputLocaleChanged() {}
bool MockInputMethod::IsInputLocaleCJK() const {
return false;
}
void MockInputMethod::OnUrlChanged() {}
#endif
void MockInputMethod::OnTextInputTypeChanged(TextInputClient* client) { … }
void MockInputMethod::OnCaretBoundsChanged(const TextInputClient* client) { … }
void MockInputMethod::CancelComposition(const TextInputClient* client) { … }
TextInputType MockInputMethod::GetTextInputType() const { … }
bool MockInputMethod::IsCandidatePopupOpen() const { … }
void MockInputMethod::SetVirtualKeyboardVisibilityIfEnabled(bool should_show) { … }
void MockInputMethod::AddObserver(InputMethodObserver* observer) { … }
void MockInputMethod::RemoveObserver(InputMethodObserver* observer) { … }
VirtualKeyboardController* MockInputMethod::GetVirtualKeyboardController() { … }
void MockInputMethod::SetVirtualKeyboardControllerForTesting(
std::unique_ptr<VirtualKeyboardController> controller) { … }
}