| OLD | NEW |
| 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/login/screens/user_selection_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/browser_process_platform_part.h" | 12 #include "chrome/browser/browser_process_platform_part.h" |
| 13 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 13 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| 14 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 14 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
| 15 #include "chrome/browser/chromeos/login/ui/views/user_board_view.h" | 15 #include "chrome/browser/chromeos/login/ui/views/user_board_view.h" |
| 16 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 16 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 17 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" | 17 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" |
| 18 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 18 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 19 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 19 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 20 #include "chrome/browser/signin/easy_unlock_service.h" | 20 #include "chrome/browser/signin/easy_unlock_service.h" |
| 21 #include "chrome/browser/signin/screenlock_bridge.h" | 21 #include "chrome/browser/signin/easy_unlock_util.h" |
| 22 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" | 22 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" |
| 23 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | 23 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
| 24 #include "components/proximity_auth/screenlock_bridge.h" |
| 25 #include "components/signin/core/browser/signin_manager_base.h" |
| 24 #include "components/user_manager/user_id.h" | 26 #include "components/user_manager/user_id.h" |
| 25 #include "components/user_manager/user_manager.h" | 27 #include "components/user_manager/user_manager.h" |
| 26 #include "components/user_manager/user_type.h" | 28 #include "components/user_manager/user_type.h" |
| 27 #include "ui/base/user_activity/user_activity_detector.h" | 29 #include "ui/base/user_activity/user_activity_detector.h" |
| 28 | 30 |
| 29 namespace chromeos { | 31 namespace chromeos { |
| 30 | 32 |
| 31 namespace { | 33 namespace { |
| 32 | 34 |
| 33 // User dictionary keys. | 35 // User dictionary keys. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 113 |
| 112 UserSelectionScreen::UserSelectionScreen(const std::string& display_type) | 114 UserSelectionScreen::UserSelectionScreen(const std::string& display_type) |
| 113 : handler_(nullptr), | 115 : handler_(nullptr), |
| 114 login_display_delegate_(nullptr), | 116 login_display_delegate_(nullptr), |
| 115 view_(nullptr), | 117 view_(nullptr), |
| 116 display_type_(display_type), | 118 display_type_(display_type), |
| 117 weak_factory_(this) { | 119 weak_factory_(this) { |
| 118 } | 120 } |
| 119 | 121 |
| 120 UserSelectionScreen::~UserSelectionScreen() { | 122 UserSelectionScreen::~UserSelectionScreen() { |
| 121 ScreenlockBridge::Get()->SetLockHandler(nullptr); | 123 GetScreenlockBridgeInstance()->SetLockHandler(nullptr); |
| 122 ui::UserActivityDetector* activity_detector = ui::UserActivityDetector::Get(); | 124 ui::UserActivityDetector* activity_detector = ui::UserActivityDetector::Get(); |
| 123 if (activity_detector->HasObserver(this)) | 125 if (activity_detector->HasObserver(this)) |
| 124 activity_detector->RemoveObserver(this); | 126 activity_detector->RemoveObserver(this); |
| 125 } | 127 } |
| 126 | 128 |
| 127 void UserSelectionScreen::InitEasyUnlock() { | 129 void UserSelectionScreen::InitEasyUnlock() { |
| 128 ScreenlockBridge::Get()->SetLockHandler(this); | 130 GetScreenlockBridgeInstance()->SetLockHandler(this); |
| 129 } | 131 } |
| 130 | 132 |
| 131 void UserSelectionScreen::SetLoginDisplayDelegate( | 133 void UserSelectionScreen::SetLoginDisplayDelegate( |
| 132 LoginDisplay::Delegate* login_display_delegate) { | 134 LoginDisplay::Delegate* login_display_delegate) { |
| 133 login_display_delegate_ = login_display_delegate; | 135 login_display_delegate_ = login_display_delegate; |
| 134 } | 136 } |
| 135 | 137 |
| 136 // static | 138 // static |
| 137 void UserSelectionScreen::FillUserDictionary( | 139 void UserSelectionScreen::FillUserDictionary( |
| 138 user_manager::User* user, | 140 user_manager::User* user, |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 // The user profile should exist if and only if this is the lock screen. | 551 // The user profile should exist if and only if this is the lock screen. |
| 550 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); | 552 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); |
| 551 | 553 |
| 552 if (!profile) | 554 if (!profile) |
| 553 profile = profile_helper->GetSigninProfile(); | 555 profile = profile_helper->GetSigninProfile(); |
| 554 | 556 |
| 555 return EasyUnlockService::Get(profile); | 557 return EasyUnlockService::Get(profile); |
| 556 } | 558 } |
| 557 | 559 |
| 558 } // namespace chromeos | 560 } // namespace chromeos |
| OLD | NEW |