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 <algorithm> | 7 #include <algorithm> |
8 #include <cstring> | 8 #include <cstring> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 87 } |
88 | 88 |
89 if (event->type() == ET_KEY_PRESSED || event->type() == ET_KEY_RELEASED) | 89 if (event->type() == ET_KEY_PRESSED || event->type() == ET_KEY_RELEASED) |
90 ProcessKeyEventPostIME(*event, is_handled); | 90 ProcessKeyEventPostIME(*event, is_handled); |
91 | 91 |
92 handling_key_event_ = false; | 92 handling_key_event_ = false; |
93 } | 93 } |
94 | 94 |
95 bool InputMethodChromeOS::DispatchKeyEvent(const ui::KeyEvent& event) { | 95 bool InputMethodChromeOS::DispatchKeyEvent(const ui::KeyEvent& event) { |
96 DCHECK(event.IsKeyEvent()); | 96 DCHECK(event.IsKeyEvent()); |
| 97 DCHECK(!(event.flags() & ui::EF_IS_SYNTHESIZED)); |
97 DCHECK(system_toplevel_window_focused()); | 98 DCHECK(system_toplevel_window_focused()); |
98 | 99 |
99 // For linux_chromeos, the ime keyboard cannot track the caps lock state by | 100 // For linux_chromeos, the ime keyboard cannot track the caps lock state by |
100 // itself, so need to call SetCapsLockEnabled() method to reflect the caps | 101 // itself, so need to call SetCapsLockEnabled() method to reflect the caps |
101 // lock state by the key event. | 102 // lock state by the key event. |
102 if (!base::SysInfo::IsRunningOnChromeOS()) { | 103 if (!base::SysInfo::IsRunningOnChromeOS()) { |
103 chromeos::input_method::InputMethodManager* manager = | 104 chromeos::input_method::InputMethodManager* manager = |
104 chromeos::input_method::InputMethodManager::Get(); | 105 chromeos::input_method::InputMethodManager::Get(); |
105 if (manager) { | 106 if (manager) { |
106 chromeos::input_method::ImeKeyboard* keyboard = manager->GetImeKeyboard(); | 107 chromeos::input_method::ImeKeyboard* keyboard = manager->GetImeKeyboard(); |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 bool InputMethodChromeOS::IsNonPasswordInputFieldFocused() { | 665 bool InputMethodChromeOS::IsNonPasswordInputFieldFocused() { |
665 TextInputType type = GetTextInputType(); | 666 TextInputType type = GetTextInputType(); |
666 return (type != TEXT_INPUT_TYPE_NONE) && (type != TEXT_INPUT_TYPE_PASSWORD); | 667 return (type != TEXT_INPUT_TYPE_NONE) && (type != TEXT_INPUT_TYPE_PASSWORD); |
667 } | 668 } |
668 | 669 |
669 bool InputMethodChromeOS::IsInputFieldFocused() { | 670 bool InputMethodChromeOS::IsInputFieldFocused() { |
670 return GetTextInputType() != TEXT_INPUT_TYPE_NONE; | 671 return GetTextInputType() != TEXT_INPUT_TYPE_NONE; |
671 } | 672 } |
672 | 673 |
673 } // namespace ui | 674 } // namespace ui |
OLD | NEW |