Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Side by Side Diff: ui/base/ime/input_method_chromeos.cc

Issue 1209663002: Use EventHandler for IME (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/wm/window_manager_unittest.cc ('k') | ui/keyboard/keyboard_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/wm/window_manager_unittest.cc ('k') | ui/keyboard/keyboard_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698