| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/existing_user_controller.h" | 5 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 base::Bind(&RefreshPoliciesOnUIThread)); | 118 base::Bind(&RefreshPoliciesOnUIThread)); |
| 119 } | 119 } |
| 120 | 120 |
| 121 // Record UMA for password login of regular user when Easy sign-in is enabled. | 121 // Record UMA for password login of regular user when Easy sign-in is enabled. |
| 122 void RecordPasswordLoginEvent(const UserContext& user_context) { | 122 void RecordPasswordLoginEvent(const UserContext& user_context) { |
| 123 EasyUnlockService* easy_unlock_service = | 123 EasyUnlockService* easy_unlock_service = |
| 124 EasyUnlockService::Get(ProfileHelper::GetSigninProfile()); | 124 EasyUnlockService::Get(ProfileHelper::GetSigninProfile()); |
| 125 if (user_context.GetUserType() == user_manager::USER_TYPE_REGULAR && | 125 if (user_context.GetUserType() == user_manager::USER_TYPE_REGULAR && |
| 126 user_context.GetAuthFlow() == UserContext::AUTH_FLOW_OFFLINE && | 126 user_context.GetAuthFlow() == UserContext::AUTH_FLOW_OFFLINE && |
| 127 easy_unlock_service) { | 127 easy_unlock_service) { |
| 128 easy_unlock_service->RecordPasswordLoginEvent( | 128 easy_unlock_service->RecordPasswordLoginEvent(user_context.GetAccountId()); |
| 129 user_context.GetAccountId().GetUserEmail()); | |
| 130 } | 129 } |
| 131 } | 130 } |
| 132 | 131 |
| 133 bool CanShowDebuggingFeatures() { | 132 bool CanShowDebuggingFeatures() { |
| 134 // We need to be on the login screen and in dev mode to show this menu item. | 133 // We need to be on the login screen and in dev mode to show this menu item. |
| 135 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 134 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 136 chromeos::switches::kSystemDevMode) && | 135 chromeos::switches::kSystemDevMode) && |
| 137 base::CommandLine::ForCurrentProcess()->HasSwitch( | 136 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 138 chromeos::switches::kLoginManager) && | 137 chromeos::switches::kLoginManager) && |
| 139 !user_manager::UserManager::Get()->IsSessionStarted(); | 138 !user_manager::UserManager::Get()->IsSessionStarted(); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 } | 430 } |
| 432 | 431 |
| 433 void ExistingUserController::ShowWrongHWIDScreen() { | 432 void ExistingUserController::ShowWrongHWIDScreen() { |
| 434 host_->StartWizard(WizardController::kWrongHWIDScreenName); | 433 host_->StartWizard(WizardController::kWrongHWIDScreenName); |
| 435 } | 434 } |
| 436 | 435 |
| 437 void ExistingUserController::Signout() { | 436 void ExistingUserController::Signout() { |
| 438 NOTREACHED(); | 437 NOTREACHED(); |
| 439 } | 438 } |
| 440 | 439 |
| 441 bool ExistingUserController::IsUserWhitelisted(const std::string& user_id) { | 440 bool ExistingUserController::IsUserWhitelisted(const AccountId& account_id) { |
| 442 bool wildcard_match = false; | 441 bool wildcard_match = false; |
| 443 if (login_performer_.get()) | 442 if (login_performer_.get()) |
| 444 return login_performer_->IsUserWhitelisted(user_id, &wildcard_match); | 443 return login_performer_->IsUserWhitelisted(account_id, &wildcard_match); |
| 445 | 444 |
| 446 return chromeos::CrosSettings::IsWhitelisted(user_id, &wildcard_match); | 445 return chromeos::CrosSettings::IsWhitelisted(account_id.GetUserEmail(), |
| 446 &wildcard_match); |
| 447 } | 447 } |
| 448 | 448 |
| 449 void ExistingUserController::OnConsumerKioskAutoLaunchCheckCompleted( | 449 void ExistingUserController::OnConsumerKioskAutoLaunchCheckCompleted( |
| 450 KioskAppManager::ConsumerKioskAutoLaunchStatus status) { | 450 KioskAppManager::ConsumerKioskAutoLaunchStatus status) { |
| 451 if (status == KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE) | 451 if (status == KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE) |
| 452 ShowKioskEnableScreen(); | 452 ShowKioskEnableScreen(); |
| 453 } | 453 } |
| 454 | 454 |
| 455 void ExistingUserController::OnEnrollmentOwnershipCheckCompleted( | 455 void ExistingUserController::OnEnrollmentOwnershipCheckCompleted( |
| 456 DeviceSettingsService::OwnershipStatus status) { | 456 DeviceSettingsService::OwnershipStatus status) { |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1196 if (!success) { | 1196 if (!success) { |
| 1197 LOG(ERROR) << "OAuth2 token fetch failed."; | 1197 LOG(ERROR) << "OAuth2 token fetch failed."; |
| 1198 OnAuthFailure(AuthFailure(AuthFailure::FAILED_TO_INITIALIZE_TOKEN)); | 1198 OnAuthFailure(AuthFailure(AuthFailure::FAILED_TO_INITIALIZE_TOKEN)); |
| 1199 return; | 1199 return; |
| 1200 } | 1200 } |
| 1201 UserSessionManager::GetInstance()->OnOAuth2TokensFetched(user_context); | 1201 UserSessionManager::GetInstance()->OnOAuth2TokensFetched(user_context); |
| 1202 PerformLogin(user_context, LoginPerformer::AUTH_MODE_EXTENSION); | 1202 PerformLogin(user_context, LoginPerformer::AUTH_MODE_EXTENSION); |
| 1203 } | 1203 } |
| 1204 | 1204 |
| 1205 } // namespace chromeos | 1205 } // namespace chromeos |
| OLD | NEW |