| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/chromeos/events/keyboard_driven_event_rewriter.h" | 5 #include "chrome/browser/chromeos/events/keyboard_driven_event_rewriter.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/events/event_rewriter.h" | 7 #include "chrome/browser/chromeos/events/event_rewriter.h" |
| 8 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
| 9 #include "chrome/browser/chromeos/system/input_device_settings.h" | 8 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| 9 #include "components/user_manager/user_manager.h" |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| 11 #include "ui/events/event_utils.h" | 11 #include "ui/events/event_utils.h" |
| 12 | 12 |
| 13 namespace chromeos { | 13 namespace chromeos { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 const int kModifierMask = ui::EF_SHIFT_DOWN; | 17 const int kModifierMask = ui::EF_SHIFT_DOWN; |
| 18 | 18 |
| 19 // Returns true if and only if it is on login screen (i.e. user is not logged | 19 // Returns true if and only if it is on login screen (i.e. user is not logged |
| 20 // in) and the keyboard driven flag in the OEM manifest is on. | 20 // in) and the keyboard driven flag in the OEM manifest is on. |
| 21 bool ShouldStripModifiersForArrowKeysAndEnter() { | 21 bool ShouldStripModifiersForArrowKeysAndEnter() { |
| 22 if (UserManager::IsInitialized() && | 22 if (user_manager::UserManager::IsInitialized() && |
| 23 !UserManager::Get()->IsSessionStarted()) { | 23 !user_manager::UserManager::Get()->IsSessionStarted()) { |
| 24 return system::InputDeviceSettings::Get() | 24 return system::InputDeviceSettings::Get() |
| 25 ->ForceKeyboardDrivenUINavigation(); | 25 ->ForceKeyboardDrivenUINavigation(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 return false; | 28 return false; |
| 29 } | 29 } |
| 30 | 30 |
| 31 } // namespace | 31 } // namespace |
| 32 | 32 |
| 33 KeyboardDrivenEventRewriter::KeyboardDrivenEventRewriter() {} | 33 KeyboardDrivenEventRewriter::KeyboardDrivenEventRewriter() {} |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 chromeos::EventRewriter::BuildRewrittenKeyEvent( | 81 chromeos::EventRewriter::BuildRewrittenKeyEvent( |
| 82 key_event, | 82 key_event, |
| 83 key_event.key_code(), | 83 key_event.key_code(), |
| 84 flags & ~(ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN), | 84 flags & ~(ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN), |
| 85 rewritten_event); | 85 rewritten_event); |
| 86 return ui::EVENT_REWRITE_REWRITTEN; | 86 return ui::EVENT_REWRITE_REWRITTEN; |
| 87 } | 87 } |
| 88 | 88 |
| 89 } // namespace chromeos | 89 } // namespace chromeos |
| OLD | NEW |