| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/views/ime/mock_input_method.h" | 5 #include "ui/views/ime/mock_input_method.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "ui/base/events/event.h" | 9 #include "ui/base/events/event.h" |
| 10 #include "ui/base/ime/text_input_client.h" | 10 #include "ui/base/ime/text_input_client.h" |
| 11 #include "ui/base/keycodes/keyboard_codes.h" | 11 #include "ui/base/keycodes/keyboard_codes.h" |
| 12 #include "ui/views/widget/widget.h" |
| 12 | 13 |
| 13 namespace views { | 14 namespace views { |
| 14 | 15 |
| 15 MockInputMethod::MockInputMethod() | 16 MockInputMethod::MockInputMethod() |
| 16 : composition_changed_(false), | 17 : composition_changed_(false), |
| 17 focus_changed_(false), | 18 focus_changed_(false), |
| 18 untranslated_ime_message_called_(false), | 19 untranslated_ime_message_called_(false), |
| 19 text_input_type_changed_(false), | 20 text_input_type_changed_(false), |
| 20 caret_bounds_changed_(false), | 21 caret_bounds_changed_(false), |
| 21 cancel_composition_called_(false), | 22 cancel_composition_called_(false), |
| (...skipping 17 matching lines...) Expand all Loading... |
| 39 SetDelegate(delegate); | 40 SetDelegate(delegate); |
| 40 } | 41 } |
| 41 | 42 |
| 42 MockInputMethod::~MockInputMethod() { | 43 MockInputMethod::~MockInputMethod() { |
| 43 } | 44 } |
| 44 | 45 |
| 45 void MockInputMethod::Init(Widget* widget) { | 46 void MockInputMethod::Init(Widget* widget) { |
| 46 InputMethodBase::Init(widget); | 47 InputMethodBase::Init(widget); |
| 47 } | 48 } |
| 48 | 49 |
| 50 void MockInputMethod::OnFocus() {} |
| 51 |
| 52 void MockInputMethod::OnBlur() {} |
| 53 |
| 49 bool MockInputMethod::OnUntranslatedIMEMessage( | 54 bool MockInputMethod::OnUntranslatedIMEMessage( |
| 50 const base::NativeEvent& event, | 55 const base::NativeEvent& event, |
| 51 NativeEventResult* result) { | 56 NativeEventResult* result) { |
| 52 untranslated_ime_message_called_ = true; | 57 untranslated_ime_message_called_ = true; |
| 53 if (result) | 58 if (result) |
| 54 *result = InputMethod::NativeEventResult(); | 59 *result = InputMethod::NativeEventResult(); |
| 55 return false; | 60 return false; |
| 56 } | 61 } |
| 57 | 62 |
| 58 void MockInputMethod::DispatchKeyEvent(const ui::KeyEvent& key) { | 63 void MockInputMethod::DispatchKeyEvent(const ui::KeyEvent& key) { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 input_locale_changed_ = false; | 194 input_locale_changed_ = false; |
| 190 } | 195 } |
| 191 | 196 |
| 192 void MockInputMethod::ClearResult() { | 197 void MockInputMethod::ClearResult() { |
| 193 composition_.Clear(); | 198 composition_.Clear(); |
| 194 composition_changed_ = false; | 199 composition_changed_ = false; |
| 195 result_text_.clear(); | 200 result_text_.clear(); |
| 196 } | 201 } |
| 197 | 202 |
| 198 } // namespace views | 203 } // namespace views |
| OLD | NEW |