Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: chrome/browser/chromeos/login/existing_user_controller.cc

Issue 10918027: Revert 154457 - Switch from SignedSettings to DeviceSettingsService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/existing_user_controller.cc
===================================================================
--- chrome/browser/chromeos/login/existing_user_controller.cc (revision 154482)
+++ chrome/browser/chromeos/login/existing_user_controller.cc (working copy)
@@ -229,11 +229,10 @@
}
if (type == chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED ||
type == chrome::NOTIFICATION_POLICY_USER_LIST_CHANGED) {
- if (host_ != NULL) {
- // Signed settings or user list changed. Notify views and update them.
- UpdateLoginDisplay(chromeos::UserManager::Get()->GetUsers());
- return;
- }
+ // Signed settings or user list changed. Notify views and update them.
+ const chromeos::UserList& users = chromeos::UserManager::Get()->GetUsers();
+ UpdateLoginDisplay(users);
+ return;
}
if (type == chrome::NOTIFICATION_AUTH_SUPPLIED) {
// Possibly the user has authenticated against a proxy server and we might
@@ -340,10 +339,22 @@
std::string password) {
resume_login_callback_.Reset();
- DeviceSettingsService::Get()->GetOwnershipStatusAsync(
- base::Bind(&ExistingUserController::PerformLogin,
- weak_factory_.GetWeakPtr(), username, password,
- LoginPerformer::AUTH_MODE_EXTENSION));
+ if (!login_performer_.get()) {
+ LoginPerformer::Delegate* delegate = this;
+ if (login_performer_delegate_.get())
+ delegate = login_performer_delegate_.get();
+ // Only one instance of LoginPerformer should exist at a time.
+ login_performer_.reset(new LoginPerformer(delegate));
+ }
+
+ // If the device is not owned yet, successfully logged in user will be owner.
+ is_owner_login_ = OwnershipService::GetSharedInstance()->GetStatus(true) ==
+ OwnershipService::OWNERSHIP_NONE;
+
+ is_login_in_progress_ = true;
+ login_performer_->CompleteLogin(username, password);
+ accessibility::MaybeSpeak(
+ l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNING_IN));
}
void ExistingUserController::Login(const std::string& username,
@@ -353,6 +364,10 @@
// Disable clicking on other windows.
login_display_->SetUIEnabled(false);
+ // If the device is not owned yet, successfully logged in user will be owner.
+ is_owner_login_ = OwnershipService::GetSharedInstance()->GetStatus(true) ==
+ OwnershipService::OWNERSHIP_NONE;
+
BootTimesLoader::Get()->RecordLoginAttempted();
if (last_login_attempt_username_ != username) {
@@ -364,21 +379,6 @@
}
num_login_attempts_++;
- DeviceSettingsService::Get()->GetOwnershipStatusAsync(
- base::Bind(&ExistingUserController::PerformLogin,
- weak_factory_.GetWeakPtr(), username, password,
- LoginPerformer::AUTH_MODE_INTERNAL));
-}
-
-void ExistingUserController::PerformLogin(
- const std::string& username,
- const std::string& password,
- LoginPerformer::AuthorizationMode auth_mode,
- DeviceSettingsService::OwnershipStatus ownership_status,
- bool is_owner) {
- // If the device is not owned yet, successfully logged in user will be owner.
- is_owner_login_ = ownership_status == DeviceSettingsService::OWNERSHIP_NONE;
-
// Use the same LoginPerformer for subsequent login as it has state
// such as Authenticator instance.
if (!login_performer_.get() || num_login_attempts_ <= 1) {
@@ -389,9 +389,8 @@
login_performer_.reset(NULL);
login_performer_.reset(new LoginPerformer(delegate));
}
-
is_login_in_progress_ = true;
- login_performer_->PerformLogin(username, password, auth_mode);
+ login_performer_->Login(username, password);
accessibility::MaybeSpeak(
l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNING_IN));
}
@@ -466,17 +465,17 @@
}
void ExistingUserController::OnStartEnterpriseEnrollment() {
- DeviceSettingsService::Get()->GetOwnershipStatusAsync(
+ OwnershipService::GetSharedInstance()->GetStatusAsync(
base::Bind(&ExistingUserController::OnEnrollmentOwnershipCheckCompleted,
weak_factory_.GetWeakPtr()));
}
void ExistingUserController::OnEnrollmentOwnershipCheckCompleted(
- DeviceSettingsService::OwnershipStatus status,
+ OwnershipService::Status status,
bool current_user_is_owner) {
- if (status == DeviceSettingsService::OWNERSHIP_NONE) {
+ if (status == OwnershipService::OWNERSHIP_NONE) {
ShowEnrollmentScreen(false, std::string());
- } else if (status == DeviceSettingsService::OWNERSHIP_TAKEN) {
+ } else if (status == OwnershipService::OWNERSHIP_TAKEN) {
// On a device that is already owned we might want to allow users to
// re-enroll if the policy information is invalid.
CrosSettingsProvider::TrustedStatus trusted_status =
Property changes on: chrome/browser/chromeos/login/existing_user_controller.cc
___________________________________________________________________
Deleted: svn:mergeinfo
« no previous file with comments | « chrome/browser/chromeos/login/existing_user_controller.h ('k') | chrome/browser/chromeos/login/language_switch_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698