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

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

Issue 1610823003: Migrate call sites LoginDisplayHostImpl::default_host to LoginDisplayHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-add-supervised-user
Patch Set: Address comments Created 4 years, 11 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
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 "chrome/browser/chromeos/events/event_rewriter.h" 5 #include "chrome/browser/chromeos/events/event_rewriter.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "ash/sticky_keys/sticky_keys_controller.h" 11 #include "ash/sticky_keys/sticky_keys_controller.h"
12 #include "ash/wm/window_state.h" 12 #include "ash/wm/window_state.h"
13 #include "ash/wm/window_util.h" 13 #include "ash/wm/window_util.h"
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/prefs/pref_service.h" 17 #include "base/prefs/pref_service.h"
18 #include "base/strings/string_split.h" 18 #include "base/strings/string_split.h"
19 #include "base/strings/string_util.h" 19 #include "base/strings/string_util.h"
20 #include "base/sys_info.h" 20 #include "base/sys_info.h"
21 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" 21 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
22 #include "chrome/browser/extensions/extension_commands_global_registry.h" 22 #include "chrome/browser/extensions/extension_commands_global_registry.h"
23 #include "chrome/browser/profiles/profile_manager.h" 23 #include "chrome/browser/profiles/profile_manager.h"
24 #include "chrome/common/pref_names.h" 24 #include "chrome/common/pref_names.h"
25 #include "chromeos/chromeos_switches.h" 25 #include "chromeos/chromeos_switches.h"
26 #include "components/user_manager/user_manager.h" 26 #include "components/user_manager/user_manager.h"
27 #include "ui/base/ime/chromeos/ime_keyboard.h" 27 #include "ui/base/ime/chromeos/ime_keyboard.h"
28 #include "ui/base/ime/chromeos/input_method_manager.h" 28 #include "ui/base/ime/chromeos/input_method_manager.h"
29 #include "ui/events/devices/device_data_manager.h" 29 #include "ui/events/devices/device_data_manager.h"
30 #include "ui/events/event.h" 30 #include "ui/events/event.h"
31 #include "ui/events/event_utils.h" 31 #include "ui/events/event_utils.h"
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 657
658 // Do nothing if we have just logged in as guest but have not restarted chrome 658 // Do nothing if we have just logged in as guest but have not restarted chrome
659 // process yet (so we are still on the login screen). In this situations we 659 // process yet (so we are still on the login screen). In this situations we
660 // have no user profile so can not do anything useful. 660 // have no user profile so can not do anything useful.
661 // Note that currently, unlike other accounts, when user logs in as guest, we 661 // Note that currently, unlike other accounts, when user logs in as guest, we
662 // restart chrome process. In future this is to be changed. 662 // restart chrome process. In future this is to be changed.
663 // TODO(glotov): remove the following condition when we do not restart chrome 663 // TODO(glotov): remove the following condition when we do not restart chrome
664 // when user logs in as guest. 664 // when user logs in as guest.
665 // TODO(kpschoedel): check whether this is still necessary. 665 // TODO(kpschoedel): check whether this is still necessary.
666 if (user_manager::UserManager::Get()->IsLoggedInAsGuest() && 666 if (user_manager::UserManager::Get()->IsLoggedInAsGuest() &&
667 LoginDisplayHostImpl::default_host()) 667 LoginDisplayHost::default_host())
668 return false; 668 return false;
669 669
670 const PrefService* pref_service = GetPrefService(); 670 const PrefService* pref_service = GetPrefService();
671 if (!pref_service) 671 if (!pref_service)
672 return false; 672 return false;
673 673
674 MutableKeyState incoming = *state; 674 MutableKeyState incoming = *state;
675 state->flags = ui::EF_NONE; 675 state->flags = ui::EF_NONE;
676 int characteristic_flag = ui::EF_NONE; 676 int characteristic_flag = ui::EF_NONE;
677 bool exact_event = false; 677 bool exact_event = false;
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 for (const auto& keyboard : keyboards) { 1145 for (const auto& keyboard : keyboards) {
1146 if (keyboard.id == device_id) { 1146 if (keyboard.id == device_id) {
1147 return KeyboardDeviceAddedInternal( 1147 return KeyboardDeviceAddedInternal(
1148 keyboard.id, keyboard.name, keyboard.vendor_id, keyboard.product_id); 1148 keyboard.id, keyboard.name, keyboard.vendor_id, keyboard.product_id);
1149 } 1149 }
1150 } 1150 }
1151 return kDeviceUnknown; 1151 return kDeviceUnknown;
1152 } 1152 }
1153 1153
1154 } // namespace chromeos 1154 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698