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

Unified Diff: chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc

Issue 2771803003: Don't start FRE from the login screen (Closed)
Patch Set: Fix browser tests Created 3 years, 8 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/enrollment/auto_enrollment_controller.cc
diff --git a/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc b/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc
index cddc9cec0003bd01eef2879b7f8601a049ffc350..d9eefc3a59626539f3f9a8188819337a35a0e71d 100644
--- a/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc
+++ b/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc
@@ -79,8 +79,9 @@ AutoEnrollmentController::FRERequirement GetFRERequirement() {
return AutoEnrollmentController::EXPLICITLY_REQUIRED;
}
if (!provider->GetMachineStatistic(system::kActivateDateKey, nullptr) &&
- !provider->GetEnterpriseMachineID().empty())
+ !provider->GetEnterpriseMachineID().empty()) {
return AutoEnrollmentController::NOT_REQUIRED;
+ }
return AutoEnrollmentController::REQUIRED;
}
@@ -190,19 +191,6 @@ void AutoEnrollmentController::Start() {
client_start_weak_factory_.GetWeakPtr()));
}
-void AutoEnrollmentController::Cancel() {
- if (client_) {
- // Cancelling the |client_| allows it to determine whether
- // its protocol finished before login was complete.
- client_.release()->CancelAndDeleteSoon();
- }
-
- // Make sure to nuke pending |client_| start sequences.
- client_start_weak_factory_.InvalidateWeakPtrs();
-
- safeguard_timer_.Stop();
-}
-
void AutoEnrollmentController::Retry() {
if (client_)
client_->Retry();
@@ -218,22 +206,14 @@ AutoEnrollmentController::RegisterProgressCallback(
void AutoEnrollmentController::OnOwnershipStatusCheckDone(
DeviceSettingsService::OwnershipStatus status) {
- policy::ServerBackedStateKeysBroker* state_keys_broker =
- g_browser_process->platform_part()
- ->browser_policy_connector_chromeos()
- ->GetStateKeysBroker();
switch (status) {
case DeviceSettingsService::OWNERSHIP_NONE:
- // TODO(tnagel): Prevent missing state keys broker in the first place.
- // https://crbug.com/703658
- if (!state_keys_broker) {
- LOG(ERROR) << "State keys broker missing.";
- UpdateState(policy::AUTO_ENROLLMENT_STATE_NO_ENROLLMENT);
- return;
- }
- state_keys_broker->RequestStateKeys(
- base::Bind(&AutoEnrollmentController::StartClient,
- client_start_weak_factory_.GetWeakPtr()));
+ g_browser_process->platform_part()
+ ->browser_policy_connector_chromeos()
+ ->GetStateKeysBroker()
+ ->RequestStateKeys(
+ base::Bind(&AutoEnrollmentController::StartClient,
+ client_start_weak_factory_.GetWeakPtr()));
return;
case DeviceSettingsService::OWNERSHIP_TAKEN:
VLOG(1) << "Device already owned, skipping auto-enrollment check.";
@@ -349,7 +329,14 @@ void AutoEnrollmentController::Timeout() {
}
// Reset state.
- Cancel();
+ if (client_) {
+ // Cancelling the |client_| allows it to determine whether
+ // its protocol finished before login was complete.
+ client_.release()->CancelAndDeleteSoon();
+ }
+
+ // Make sure to nuke pending |client_| start sequences.
+ client_start_weak_factory_.InvalidateWeakPtrs();
}
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698