1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/input_method/mock_input_method_engine.h"
9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/string_util.h"
13 #include "base/strings/utf_string_conversions.h"
14 #include "chromeos/ime/component_extension_ime_manager.h"
15 #include "chromeos/ime/extension_ime_util.h"
16 #include "chromeos/ime/ibus_keymap.h"
17 #include "chromeos/ime/ibus_text.h"
18 #include "chromeos/ime/input_method_manager.h"
19 #include "ui/base/ime/candidate_window.h"
20 #include "ui/events/event.h"
21 #include "ui/events/keycodes/dom4/keycode_converter.h"
22 #include "ui/events/keycodes/keyboard_code_conversion_x.h"
23 #include "ui/keyboard/keyboard_controller.h"
27 MockInputMethodEngine::MockInputMethodEngine(
28 const input_method::InputMethodDescriptor& descriptor)
29 : descriptor_(descriptor) {}
31 MockInputMethodEngine::~MockInputMethodEngine() {}
33 const input_method::InputMethodDescriptor&
34 MockInputMethodEngine::GetDescriptor() const {
38 void MockInputMethodEngine::StartIme() {
41 bool MockInputMethodEngine::SetComposition(
47 const std::vector<SegmentInfo>& segments,
52 bool MockInputMethodEngine::ClearComposition(int context_id,
57 bool MockInputMethodEngine::CommitText(int context_id,
63 bool MockInputMethodEngine::SendKeyEvents(
65 const std::vector<KeyboardEvent>& events) {
69 const MockInputMethodEngine::CandidateWindowProperty&
70 MockInputMethodEngine::GetCandidateWindowProperty() const {
71 return candidate_window_property_;
74 void MockInputMethodEngine::SetCandidateWindowProperty(
75 const CandidateWindowProperty& property) {
78 bool MockInputMethodEngine::SetCandidateWindowVisible(bool visible,
83 bool MockInputMethodEngine::SetCandidates(
85 const std::vector<Candidate>& candidates,
90 bool MockInputMethodEngine::SetCursorPosition(int context_id,
96 bool MockInputMethodEngine::SetMenuItems(const std::vector<MenuItem>& items) {
100 bool MockInputMethodEngine::UpdateMenuItems(
101 const std::vector<MenuItem>& items) {
105 bool MockInputMethodEngine::IsActive() const {
109 void MockInputMethodEngine::KeyEventDone(input_method::KeyEventHandle* key_data,
113 bool MockInputMethodEngine::DeleteSurroundingText(int context_id,
115 size_t number_of_chars,
116 std::string* error) {
120 void MockInputMethodEngine::HideInputView() {
123 void MockInputMethodEngine::FocusIn(
124 const IMEEngineHandlerInterface::InputContext& input_context) {
127 void MockInputMethodEngine::FocusOut() {
130 void MockInputMethodEngine::Enable() {
133 void MockInputMethodEngine::Disable() {
136 void MockInputMethodEngine::PropertyActivate(const std::string& property_name) {
139 void MockInputMethodEngine::Reset() {
142 void MockInputMethodEngine::ProcessKeyEvent(
143 const ui::KeyEvent& key_event,
144 const KeyEventDoneCallback& callback) {
147 void MockInputMethodEngine::CandidateClicked(uint32 index) {
150 void MockInputMethodEngine::SetSurroundingText(const std::string& text,
155 } // namespace chromeos