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

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

Issue 2585633004: ozone: Allow ozone evdev/kvm features to be enabled without running on ChromeOS. (Closed)
Patch Set: fix bad rebase Created 4 years 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cstring> 10 #include <cstring>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 void InputMethodChromeOS::DispatchKeyEvent( 60 void InputMethodChromeOS::DispatchKeyEvent(
61 ui::KeyEvent* event, 61 ui::KeyEvent* event,
62 std::unique_ptr<AckCallback> ack_callback) { 62 std::unique_ptr<AckCallback> ack_callback) {
63 DCHECK(event->IsKeyEvent()); 63 DCHECK(event->IsKeyEvent());
64 DCHECK(!(event->flags() & ui::EF_IS_SYNTHESIZED)); 64 DCHECK(!(event->flags() & ui::EF_IS_SYNTHESIZED));
65 65
66 // For linux_chromeos, the ime keyboard cannot track the caps lock state by 66 // For linux_chromeos, the ime keyboard cannot track the caps lock state by
67 // itself, so need to call SetCapsLockEnabled() method to reflect the caps 67 // itself, so need to call SetCapsLockEnabled() method to reflect the caps
68 // lock state by the key event. 68 // lock state by the key event.
69 if (!base::SysInfo::IsRunningOnChromeOS()) { 69 if (!base::SysInfo::IsRunningAsSystemCompositor()) {
70 chromeos::input_method::InputMethodManager* manager = 70 chromeos::input_method::InputMethodManager* manager =
71 chromeos::input_method::InputMethodManager::Get(); 71 chromeos::input_method::InputMethodManager::Get();
72 if (manager) { 72 if (manager) {
73 chromeos::input_method::ImeKeyboard* keyboard = manager->GetImeKeyboard(); 73 chromeos::input_method::ImeKeyboard* keyboard = manager->GetImeKeyboard();
74 if (keyboard && event->type() == ui::ET_KEY_PRESSED) { 74 if (keyboard && event->type() == ui::ET_KEY_PRESSED) {
75 keyboard->SetCapsLockEnabled((event->key_code() == ui::VKEY_CAPITAL) ? 75 keyboard->SetCapsLockEnabled((event->key_code() == ui::VKEY_CAPITAL) ?
76 !keyboard->CapsLockIsEnabled() : event->IsCapsLockOn()); 76 !keyboard->CapsLockIsEnabled() : event->IsCapsLockOn());
77 } 77 }
78 } 78 }
79 } 79 }
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 bool InputMethodChromeOS::IsNonPasswordInputFieldFocused() { 648 bool InputMethodChromeOS::IsNonPasswordInputFieldFocused() {
649 TextInputType type = GetTextInputType(); 649 TextInputType type = GetTextInputType();
650 return (type != TEXT_INPUT_TYPE_NONE) && (type != TEXT_INPUT_TYPE_PASSWORD); 650 return (type != TEXT_INPUT_TYPE_NONE) && (type != TEXT_INPUT_TYPE_PASSWORD);
651 } 651 }
652 652
653 bool InputMethodChromeOS::IsInputFieldFocused() { 653 bool InputMethodChromeOS::IsInputFieldFocused() {
654 return GetTextInputType() != TEXT_INPUT_TYPE_NONE; 654 return GetTextInputType() != TEXT_INPUT_TYPE_NONE;
655 } 655 }
656 656
657 } // namespace ui 657 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698