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

Side by Side Diff: chrome/browser/chromeos/events/keyboard_driven_event_rewriter.cc

Issue 375413002: Replace chromeos::UserManager::Get() with chromeos::GetUserManager(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 6 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 | Annotate | Revision Log
OLDNEW
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/login/users/user_manager.h" 7 #include "chrome/browser/chromeos/login/users/user_manager.h"
8 #include "chrome/browser/chromeos/system/input_device_settings.h" 8 #include "chrome/browser/chromeos/system/input_device_settings.h"
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/events/event_utils.h" 10 #include "ui/events/event_utils.h"
11 11
12 namespace chromeos { 12 namespace chromeos {
13 13
14 namespace { 14 namespace {
15 15
16 const int kModifierMask = ui::EF_SHIFT_DOWN; 16 const int kModifierMask = ui::EF_SHIFT_DOWN;
17 17
18 // Returns true if and only if it is on login screen (i.e. user is not logged 18 // Returns true if and only if it is on login screen (i.e. user is not logged
19 // in) and the keyboard driven flag in the OEM manifest is on. 19 // in) and the keyboard driven flag in the OEM manifest is on.
20 bool ShouldStripModifiersForArrowKeysAndEnter() { 20 bool ShouldStripModifiersForArrowKeysAndEnter() {
21 if (UserManager::IsInitialized() && 21 if (UserManager::IsInitialized() && !GetUserManager()->IsSessionStarted()) {
22 !UserManager::Get()->IsSessionStarted()) {
23 return system::InputDeviceSettings::Get() 22 return system::InputDeviceSettings::Get()
24 ->ForceKeyboardDrivenUINavigation(); 23 ->ForceKeyboardDrivenUINavigation();
25 } 24 }
26 25
27 return false; 26 return false;
28 } 27 }
29 28
30 } // namespace 29 } // namespace
31 30
32 KeyboardDrivenEventRewriter::KeyboardDrivenEventRewriter() {} 31 KeyboardDrivenEventRewriter::KeyboardDrivenEventRewriter() {}
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 return ui::EVENT_REWRITE_CONTINUE; 76 return ui::EVENT_REWRITE_CONTINUE;
78 } 77 }
79 78
80 rewritten_event->reset(new ui::KeyEvent(key_event)); 79 rewritten_event->reset(new ui::KeyEvent(key_event));
81 (*rewritten_event)->set_flags( 80 (*rewritten_event)->set_flags(
82 flags & ~(ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)); 81 flags & ~(ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN));
83 return ui::EVENT_REWRITE_REWRITTEN; 82 return ui::EVENT_REWRITE_REWRITTEN;
84 } 83 }
85 84
86 } // namespace chromeos 85 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/events/event_rewriter.cc ('k') | chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698