Chromium Code Reviews| 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 "ui/base/ime/input_method_chromeos.h" | 5 #include "ui/base/ime/input_method_chromeos.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cstring> | 10 #include <cstring> |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 354 ignore_result(DispatchKeyEventPostIME(event)); | 354 ignore_result(DispatchKeyEventPostIME(event)); |
| 355 } | 355 } |
| 356 | 356 |
| 357 void InputMethodChromeOS::ProcessFilteredKeyPressEvent(ui::KeyEvent* event) { | 357 void InputMethodChromeOS::ProcessFilteredKeyPressEvent(ui::KeyEvent* event) { |
| 358 if (NeedInsertChar()) { | 358 if (NeedInsertChar()) { |
| 359 ignore_result(DispatchKeyEventPostIME(event)); | 359 ignore_result(DispatchKeyEventPostIME(event)); |
| 360 return; | 360 return; |
| 361 } | 361 } |
| 362 ui::KeyEvent fabricated_event(ET_KEY_PRESSED, | 362 ui::KeyEvent fabricated_event(ET_KEY_PRESSED, |
| 363 VKEY_PROCESSKEY, | 363 VKEY_PROCESSKEY, |
| 364 event->flags()); | 364 event->code(), |
| 365 event->flags(), | |
| 366 event->GetDomKey(), | |
| 367 event->time_stamp()); | |
|
Shu Chen
2016/03/11 16:24:53
Can you please confirm whether the CJK input metho
chongz
2016/03/11 21:17:26
Sure, but can I have some help on how to include I
Shu Chen
2016/03/14 01:32:17
Ack. It makes sense.
| |
| 365 ignore_result(DispatchKeyEventPostIME(&fabricated_event)); | 368 ignore_result(DispatchKeyEventPostIME(&fabricated_event)); |
| 366 if (fabricated_event.stopped_propagation()) | 369 if (fabricated_event.stopped_propagation()) |
| 367 event->StopPropagation(); | 370 event->StopPropagation(); |
| 368 } | 371 } |
| 369 | 372 |
| 370 void InputMethodChromeOS::ProcessUnfilteredKeyPressEvent( | 373 void InputMethodChromeOS::ProcessUnfilteredKeyPressEvent( |
| 371 ui::KeyEvent* event) { | 374 ui::KeyEvent* event) { |
| 372 const TextInputClient* prev_client = GetTextInputClient(); | 375 const TextInputClient* prev_client = GetTextInputClient(); |
| 373 ignore_result(DispatchKeyEventPostIME(event)); | 376 ignore_result(DispatchKeyEventPostIME(event)); |
| 374 if (event->stopped_propagation()) { | 377 if (event->stopped_propagation()) { |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 633 bool InputMethodChromeOS::IsNonPasswordInputFieldFocused() { | 636 bool InputMethodChromeOS::IsNonPasswordInputFieldFocused() { |
| 634 TextInputType type = GetTextInputType(); | 637 TextInputType type = GetTextInputType(); |
| 635 return (type != TEXT_INPUT_TYPE_NONE) && (type != TEXT_INPUT_TYPE_PASSWORD); | 638 return (type != TEXT_INPUT_TYPE_NONE) && (type != TEXT_INPUT_TYPE_PASSWORD); |
| 636 } | 639 } |
| 637 | 640 |
| 638 bool InputMethodChromeOS::IsInputFieldFocused() { | 641 bool InputMethodChromeOS::IsInputFieldFocused() { |
| 639 return GetTextInputType() != TEXT_INPUT_TYPE_NONE; | 642 return GetTextInputType() != TEXT_INPUT_TYPE_NONE; |
| 640 } | 643 } |
| 641 | 644 |
| 642 } // namespace ui | 645 } // namespace ui |
| OLD | NEW |