OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/input_method/mock_input_method_engine.h" | 5 #include "chrome/browser/chromeos/input_method/mock_input_method_engine.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 namespace chromeos { | 9 namespace chromeos { |
10 | 10 |
11 MockInputMethodEngine::MockInputMethodEngine( | 11 MockInputMethodEngine::MockInputMethodEngine() {} |
12 const input_method::InputMethodDescriptor& descriptor) | |
13 : descriptor_(descriptor) {} | |
14 | 12 |
15 MockInputMethodEngine::~MockInputMethodEngine() {} | 13 MockInputMethodEngine::~MockInputMethodEngine() {} |
16 | 14 |
17 const input_method::InputMethodDescriptor& | 15 const std::string& MockInputMethodEngine::GetActiveComponentId() const { |
18 MockInputMethodEngine::GetDescriptor() const { | 16 return active_component_id_; |
19 return descriptor_; | |
20 } | |
21 | |
22 void MockInputMethodEngine::NotifyImeReady() { | |
23 } | 17 } |
24 | 18 |
25 bool MockInputMethodEngine::SetComposition( | 19 bool MockInputMethodEngine::SetComposition( |
26 int context_id, | 20 int context_id, |
27 const char* text, | 21 const char* text, |
28 int selection_start, | 22 int selection_start, |
29 int selection_end, | 23 int selection_end, |
30 int cursor, | 24 int cursor, |
31 const std::vector<SegmentInfo>& segments, | 25 const std::vector<SegmentInfo>& segments, |
32 std::string* error) { | 26 std::string* error) { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 void MockInputMethodEngine::HideInputView() { | 94 void MockInputMethodEngine::HideInputView() { |
101 } | 95 } |
102 | 96 |
103 void MockInputMethodEngine::FocusIn( | 97 void MockInputMethodEngine::FocusIn( |
104 const IMEEngineHandlerInterface::InputContext& input_context) { | 98 const IMEEngineHandlerInterface::InputContext& input_context) { |
105 } | 99 } |
106 | 100 |
107 void MockInputMethodEngine::FocusOut() { | 101 void MockInputMethodEngine::FocusOut() { |
108 } | 102 } |
109 | 103 |
110 void MockInputMethodEngine::Enable() { | 104 void MockInputMethodEngine::Enable(const std::string& component_id) { |
| 105 active_component_id_ = component_id; |
111 } | 106 } |
112 | 107 |
113 void MockInputMethodEngine::Disable() { | 108 void MockInputMethodEngine::Disable() { |
| 109 active_component_id_.clear(); |
114 } | 110 } |
115 | 111 |
116 void MockInputMethodEngine::PropertyActivate(const std::string& property_name) { | 112 void MockInputMethodEngine::PropertyActivate(const std::string& property_name) { |
117 last_activated_property_ = property_name; | 113 last_activated_property_ = property_name; |
118 } | 114 } |
119 | 115 |
120 void MockInputMethodEngine::Reset() { | 116 void MockInputMethodEngine::Reset() { |
121 } | 117 } |
122 | 118 |
123 void MockInputMethodEngine::ProcessKeyEvent( | 119 void MockInputMethodEngine::ProcessKeyEvent( |
124 const ui::KeyEvent& key_event, | 120 const ui::KeyEvent& key_event, |
125 const KeyEventDoneCallback& callback) { | 121 const KeyEventDoneCallback& callback) { |
126 } | 122 } |
127 | 123 |
128 void MockInputMethodEngine::CandidateClicked(uint32 index) { | 124 void MockInputMethodEngine::CandidateClicked(uint32 index) { |
129 } | 125 } |
130 | 126 |
131 void MockInputMethodEngine::SetSurroundingText(const std::string& text, | 127 void MockInputMethodEngine::SetSurroundingText(const std::string& text, |
132 uint32 cursor_pos, | 128 uint32 cursor_pos, |
133 uint32 anchor_pos) { | 129 uint32 anchor_pos) { |
134 } | 130 } |
135 | 131 |
136 } // namespace chromeos | 132 } // namespace chromeos |
OLD | NEW |