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

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

Issue 10443125: Allow re-enrollment to the same domain in case of policy data loss. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved the domain extraction to Authenticator and added custom error message. Created 8 years, 6 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
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc
index 8bdf93c289ad4174f57efa4b0cecaa42ecc23fdd..48474867574bfb1dede6f3caa9efb4d69d993989 100644
--- a/chrome/browser/chromeos/login/existing_user_controller.cc
+++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -472,8 +472,23 @@ void ExistingUserController::OnStartEnterpriseEnrollment() {
void ExistingUserController::OnEnrollmentOwnershipCheckCompleted(
OwnershipService::Status status,
bool current_user_is_owner) {
- if (status == OwnershipService::OWNERSHIP_NONE)
+ if (status == OwnershipService::OWNERSHIP_NONE) {
ShowEnrollmentScreen(false, std::string());
+ } 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 has been screwed.
Mattias Nissler (ping if slow) 2012/06/08 13:13:44 s/has been screwed/is invalid/, we really don't kn
pastarmovj 2012/06/08 15:07:12 Done.
+ CrosSettingsProvider::TrustedStatus trusted_status =
+ CrosSettings::Get()->PrepareTrustedValues(
+ base::Bind(
+ &ExistingUserController::OnEnrollmentOwnershipCheckCompleted,
+ weak_factory_.GetWeakPtr(), status, current_user_is_owner));
+ if (trusted_status == CrosSettingsProvider::PERMANENTLY_UNTRUSTED)
+ ShowEnrollmentScreen(false, std::string());
+ } else {
+ // OwnershipService::GetStatusAsync is supposed to return either
+ // OWNERSHIP_NONE or OWNERSHIP_TAKEN.
+ NOTREACHED();
+ }
}
void ExistingUserController::ShowEnrollmentScreen(bool is_auto_enrollment,

Powered by Google App Engine
This is Rietveld 408576698