| 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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 void ExistingUserController::Signout() { | 458 void ExistingUserController::Signout() { |
| 459 NOTREACHED(); | 459 NOTREACHED(); |
| 460 } | 460 } |
| 461 | 461 |
| 462 void ExistingUserController::OnUserSelected(const std::string& username) { | 462 void ExistingUserController::OnUserSelected(const std::string& username) { |
| 463 login_performer_.reset(NULL); | 463 login_performer_.reset(NULL); |
| 464 num_login_attempts_ = 0; | 464 num_login_attempts_ = 0; |
| 465 } | 465 } |
| 466 | 466 |
| 467 void ExistingUserController::OnStartEnterpriseEnrollment() { | 467 void ExistingUserController::OnStartEnterpriseEnrollment() { |
| 468 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 468 OwnershipService::GetSharedInstance()->GetStatusAsync( |
| 469 if (command_line->HasSwitch(switches::kEnableDevicePolicy)) { | 469 base::Bind(&ExistingUserController::OnEnrollmentOwnershipCheckCompleted, |
| 470 OwnershipService::GetSharedInstance()->GetStatusAsync( | 470 weak_factory_.GetWeakPtr())); |
| 471 base::Bind(&ExistingUserController::OnEnrollmentOwnershipCheckCompleted, | |
| 472 weak_factory_.GetWeakPtr())); | |
| 473 } | |
| 474 } | 471 } |
| 475 | 472 |
| 476 void ExistingUserController::OnEnrollmentOwnershipCheckCompleted( | 473 void ExistingUserController::OnEnrollmentOwnershipCheckCompleted( |
| 477 OwnershipService::Status status, | 474 OwnershipService::Status status, |
| 478 bool current_user_is_owner) { | 475 bool current_user_is_owner) { |
| 479 if (status == OwnershipService::OWNERSHIP_NONE) { | 476 if (status == OwnershipService::OWNERSHIP_NONE) { |
| 480 ShowEnrollmentScreen(false, std::string()); | 477 ShowEnrollmentScreen(false, std::string()); |
| 481 } else if (status == OwnershipService::OWNERSHIP_TAKEN) { | 478 } else if (status == OwnershipService::OWNERSHIP_TAKEN) { |
| 482 // On a device that is already owned we might want to allow users to | 479 // On a device that is already owned we might want to allow users to |
| 483 // re-enroll if the policy information is invalid. | 480 // re-enroll if the policy information is invalid. |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 // Invalidate OAuth token, since it can't be correct after password is | 921 // Invalidate OAuth token, since it can't be correct after password is |
| 925 // changed. | 922 // changed. |
| 926 UserManager::Get()->SaveUserOAuthStatus(username, | 923 UserManager::Get()->SaveUserOAuthStatus(username, |
| 927 User::OAUTH_TOKEN_STATUS_INVALID); | 924 User::OAUTH_TOKEN_STATUS_INVALID); |
| 928 | 925 |
| 929 login_display_->SetUIEnabled(true); | 926 login_display_->SetUIEnabled(true); |
| 930 login_display_->ShowGaiaPasswordChanged(username); | 927 login_display_->ShowGaiaPasswordChanged(username); |
| 931 } | 928 } |
| 932 | 929 |
| 933 } // namespace chromeos | 930 } // namespace chromeos |
| OLD | NEW |