| 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/screenlock_bridge.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/user_manager/user_manager.h" | 24 #include "components/user_manager/user_manager.h" |
| 25 #include "components/user_manager/user_type.h" | 25 #include "components/user_manager/user_type.h" |
| 26 #include "ui/wm/core/user_activity_detector.h" | 26 #include "ui/base/user_activity/user_activity_detector.h" |
| 27 | 27 |
| 28 namespace chromeos { | 28 namespace chromeos { |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 // User dictionary keys. | 32 // User dictionary keys. |
| 33 const char kKeyUsername[] = "username"; | 33 const char kKeyUsername[] = "username"; |
| 34 const char kKeyDisplayName[] = "displayName"; | 34 const char kKeyDisplayName[] = "displayName"; |
| 35 const char kKeyEmailAddress[] = "emailAddress"; | 35 const char kKeyEmailAddress[] = "emailAddress"; |
| 36 const char kKeyEnterpriseDomain[] = "enterpriseDomain"; | 36 const char kKeyEnterpriseDomain[] = "enterpriseDomain"; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 UserSelectionScreen::UserSelectionScreen(const std::string& display_type) | 108 UserSelectionScreen::UserSelectionScreen(const std::string& display_type) |
| 109 : handler_(nullptr), | 109 : handler_(nullptr), |
| 110 login_display_delegate_(nullptr), | 110 login_display_delegate_(nullptr), |
| 111 view_(nullptr), | 111 view_(nullptr), |
| 112 display_type_(display_type) { | 112 display_type_(display_type) { |
| 113 } | 113 } |
| 114 | 114 |
| 115 UserSelectionScreen::~UserSelectionScreen() { | 115 UserSelectionScreen::~UserSelectionScreen() { |
| 116 ScreenlockBridge::Get()->SetLockHandler(nullptr); | 116 ScreenlockBridge::Get()->SetLockHandler(nullptr); |
| 117 wm::UserActivityDetector* activity_detector = wm::UserActivityDetector::Get(); | 117 ui::UserActivityDetector* activity_detector = ui::UserActivityDetector::Get(); |
| 118 if (activity_detector->HasObserver(this)) | 118 if (activity_detector->HasObserver(this)) |
| 119 activity_detector->RemoveObserver(this); | 119 activity_detector->RemoveObserver(this); |
| 120 } | 120 } |
| 121 | 121 |
| 122 void UserSelectionScreen::InitEasyUnlock() { | 122 void UserSelectionScreen::InitEasyUnlock() { |
| 123 ScreenlockBridge::Get()->SetLockHandler(this); | 123 ScreenlockBridge::Get()->SetLockHandler(this); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void UserSelectionScreen::SetLoginDisplayDelegate( | 126 void UserSelectionScreen::SetLoginDisplayDelegate( |
| 127 LoginDisplay::Delegate* login_display_delegate) { | 127 LoginDisplay::Delegate* login_display_delegate) { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 220 |
| 221 void UserSelectionScreen::SetView(UserBoardView* view) { | 221 void UserSelectionScreen::SetView(UserBoardView* view) { |
| 222 view_ = view; | 222 view_ = view; |
| 223 } | 223 } |
| 224 | 224 |
| 225 void UserSelectionScreen::Init(const user_manager::UserList& users, | 225 void UserSelectionScreen::Init(const user_manager::UserList& users, |
| 226 bool show_guest) { | 226 bool show_guest) { |
| 227 users_ = users; | 227 users_ = users; |
| 228 show_guest_ = show_guest; | 228 show_guest_ = show_guest; |
| 229 | 229 |
| 230 wm::UserActivityDetector* activity_detector = wm::UserActivityDetector::Get(); | 230 ui::UserActivityDetector* activity_detector = ui::UserActivityDetector::Get(); |
| 231 if (!activity_detector->HasObserver(this)) | 231 if (!activity_detector->HasObserver(this)) |
| 232 activity_detector->AddObserver(this); | 232 activity_detector->AddObserver(this); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void UserSelectionScreen::OnBeforeUserRemoved(const std::string& username) { | 235 void UserSelectionScreen::OnBeforeUserRemoved(const std::string& username) { |
| 236 for (user_manager::UserList::iterator it = users_.begin(); it != users_.end(); | 236 for (user_manager::UserList::iterator it = users_.begin(); it != users_.end(); |
| 237 ++it) { | 237 ++it) { |
| 238 if ((*it)->email() == username) { | 238 if ((*it)->email() == username) { |
| 239 users_.erase(it); | 239 users_.erase(it); |
| 240 break; | 240 break; |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 // The user profile should exists if and only if this is lock screen. | 485 // The user profile should exists if and only if this is lock screen. |
| 486 DCHECK_NE(!profile, !ScreenLocker::default_screen_locker()); | 486 DCHECK_NE(!profile, !ScreenLocker::default_screen_locker()); |
| 487 | 487 |
| 488 if (!profile) | 488 if (!profile) |
| 489 profile = profile_helper->GetSigninProfile(); | 489 profile = profile_helper->GetSigninProfile(); |
| 490 | 490 |
| 491 return EasyUnlockService::Get(profile); | 491 return EasyUnlockService::Get(profile); |
| 492 } | 492 } |
| 493 | 493 |
| 494 } // namespace chromeos | 494 } // namespace chromeos |
| OLD | NEW |