Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base/ime/input_method_base.h" | 5 #include "ui/base/ime/input_method_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 else | 192 else |
| 193 GetTextInputClient()->ClearCompositionText(); | 193 GetTextInputClient()->ClearCompositionText(); |
| 194 } | 194 } |
| 195 SendFakeProcessKeyEvent(false); | 195 SendFakeProcessKeyEvent(false); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void InputMethodBase::DeleteSurroundingText(int32_t offset, uint32_t length) {} | 198 void InputMethodBase::DeleteSurroundingText(int32_t offset, uint32_t length) {} |
| 199 | 199 |
| 200 void InputMethodBase::SendKeyEvent(KeyEvent* event) { | 200 void InputMethodBase::SendKeyEvent(KeyEvent* event) { |
| 201 sending_key_event_ = true; | 201 sending_key_event_ = true; |
| 202 key_events_for_test.push_back(new KeyEvent(*event)); | |
|
Devlin
2016/06/22 16:33:12
This never gets cleared in production, right? And
Azure Wei
2016/06/23 02:45:23
Fixed with adding test flag in InputMethod.
| |
| 202 DispatchKeyEvent(event); | 203 DispatchKeyEvent(event); |
| 203 sending_key_event_ = false; | 204 sending_key_event_ = false; |
| 204 } | 205 } |
| 205 | 206 |
| 207 InputMethod* InputMethodBase::GetInputMethod() { | |
| 208 return this; | |
| 209 } | |
| 210 | |
| 211 std::vector<ui::KeyEvent*> InputMethodBase::GetKeyEventsForTest() { | |
| 212 return key_events_for_test; | |
| 213 } | |
| 214 | |
| 206 } // namespace ui | 215 } // namespace ui |
| OLD | NEW |