| 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 <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 | 438 |
| 439 BootTimesRecorder::Get()->RecordLoginAttempted(); | 439 BootTimesRecorder::Get()->RecordLoginAttempted(); |
| 440 | 440 |
| 441 // Use the same LoginPerformer for subsequent login as it has state | 441 // Use the same LoginPerformer for subsequent login as it has state |
| 442 // such as Authenticator instance. | 442 // such as Authenticator instance. |
| 443 if (!login_performer_.get() || num_login_attempts_ <= 1) { | 443 if (!login_performer_.get() || num_login_attempts_ <= 1) { |
| 444 // Only one instance of LoginPerformer should exist at a time. | 444 // Only one instance of LoginPerformer should exist at a time. |
| 445 login_performer_.reset(nullptr); | 445 login_performer_.reset(nullptr); |
| 446 login_performer_.reset(new ChromeLoginPerformer(this)); | 446 login_performer_.reset(new ChromeLoginPerformer(this)); |
| 447 } | 447 } |
| 448 policy::BrowserPolicyConnectorChromeOS* connector = |
| 449 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 450 if (connector->IsActiveDirectoryManaged() && |
| 451 user_context.GetAuthFlow() != UserContext::AUTH_FLOW_ACTIVE_DIRECTORY) { |
| 452 PerformLoginFinishedActions(false /* don't start auto login timer */); |
| 453 ShowError(IDS_LOGIN_ERROR_GOOGLE_ACCOUNT_NOT_ALLOWED, |
| 454 "Google accounts are not allowed on this device"); |
| 455 return; |
| 456 } |
| 448 | 457 |
| 449 if (gaia::ExtractDomainName(user_context.GetAccountId().GetUserEmail()) == | 458 if (gaia::ExtractDomainName(user_context.GetAccountId().GetUserEmail()) == |
| 450 user_manager::kSupervisedUserDomain) { | 459 user_manager::kSupervisedUserDomain) { |
| 451 login_performer_->LoginAsSupervisedUser(user_context); | 460 login_performer_->LoginAsSupervisedUser(user_context); |
| 452 } else { | 461 } else { |
| 453 login_performer_->PerformLogin(user_context, auth_mode); | 462 login_performer_->PerformLogin(user_context, auth_mode); |
| 454 RecordPasswordLoginEvent(user_context); | 463 RecordPasswordLoginEvent(user_context); |
| 455 } | 464 } |
| 456 SendAccessibilityAlert( | 465 SendAccessibilityAlert( |
| 457 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNING_IN)); | 466 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNING_IN)); |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 login_display_->ShowUnrecoverableCrypthomeErrorDialog(); | 1369 login_display_->ShowUnrecoverableCrypthomeErrorDialog(); |
| 1361 } | 1370 } |
| 1362 | 1371 |
| 1363 void ExistingUserController::ClearRecordedNames() { | 1372 void ExistingUserController::ClearRecordedNames() { |
| 1364 display_email_.clear(); | 1373 display_email_.clear(); |
| 1365 display_name_.clear(); | 1374 display_name_.clear(); |
| 1366 given_name_.clear(); | 1375 given_name_.clear(); |
| 1367 } | 1376 } |
| 1368 | 1377 |
| 1369 } // namespace chromeos | 1378 } // namespace chromeos |
| OLD | NEW |