| Index: chrome/browser/chromeos/policy/auto_enrollment_client.cc
|
| diff --git a/chrome/browser/chromeos/policy/auto_enrollment_client.cc b/chrome/browser/chromeos/policy/auto_enrollment_client.cc
|
| index 43aeb0b82280a202ba6e5978b71b5fcf0fba6f8d..dd4c8d0b06cd7b7a5c910faa391a85c38afba623 100644
|
| --- a/chrome/browser/chromeos/policy/auto_enrollment_client.cc
|
| +++ b/chrome/browser/chromeos/policy/auto_enrollment_client.cc
|
| @@ -78,7 +78,7 @@ std::string ConvertRestoreMode(
|
| }
|
|
|
| // Return is required to avoid compiler warning.
|
| - NOTREACHED() << "Bad restore mode " << restore_mode;
|
| + NOTREACHED() << "Bad restore_mode=" << restore_mode;
|
| return std::string();
|
| }
|
|
|
| @@ -190,6 +190,7 @@ bool AutoEnrollmentClient::RetryStep() {
|
| return true;
|
|
|
| if (GetCachedDecision()) {
|
| + VLOG(1) << "Cached: has_state=" << has_server_state_;
|
| // The bucket download check has completed already. If it came back
|
| // positive, then device state should be (re-)downloaded.
|
| if (has_server_state_) {
|
| @@ -222,11 +223,15 @@ void AutoEnrollmentClient::NextStep() {
|
|
|
| // Protocol finished successfully, report result.
|
| const RestoreMode restore_mode = GetRestoreMode();
|
| - if (restore_mode == RESTORE_MODE_REENROLLMENT_REQUESTED ||
|
| - restore_mode == RESTORE_MODE_REENROLLMENT_ENFORCED) {
|
| - ReportProgress(AUTO_ENROLLMENT_STATE_TRIGGER_ENROLLMENT);
|
| - } else {
|
| - ReportProgress(AUTO_ENROLLMENT_STATE_NO_ENROLLMENT);
|
| + switch (restore_mode) {
|
| + case RESTORE_MODE_NONE:
|
| + case RESTORE_MODE_DISABLED:
|
| + ReportProgress(AUTO_ENROLLMENT_STATE_NO_ENROLLMENT);
|
| + break;
|
| + case RESTORE_MODE_REENROLLMENT_REQUESTED:
|
| + case RESTORE_MODE_REENROLLMENT_ENFORCED:
|
| + ReportProgress(AUTO_ENROLLMENT_STATE_TRIGGER_ENROLLMENT);
|
| + break;
|
| }
|
| }
|
|
|
| @@ -242,6 +247,7 @@ void AutoEnrollmentClient::SendBucketDownloadRequest() {
|
|
|
| ReportProgress(AUTO_ENROLLMENT_STATE_PENDING);
|
|
|
| + VLOG(1) << "Request bucket #" << remainder;
|
| request_job_.reset(
|
| device_management_service_->CreateJob(
|
| DeviceManagementRequestJob::TYPE_AUTO_ENROLLMENT,
|
| @@ -260,6 +266,7 @@ void AutoEnrollmentClient::SendBucketDownloadRequest() {
|
| void AutoEnrollmentClient::SendDeviceStateRequest() {
|
| ReportProgress(AUTO_ENROLLMENT_STATE_PENDING);
|
|
|
| + VLOG(1) << "State request for key: " << server_backed_state_key_;
|
| request_job_.reset(
|
| device_management_service_->CreateJob(
|
| DeviceManagementRequestJob::TYPE_DEVICE_STATE_RETRIEVAL,
|
| @@ -353,8 +360,7 @@ bool AutoEnrollmentClient::OnBucketDownloadRequestCompletion(
|
| local_state_->SetBoolean(prefs::kShouldAutoEnroll, has_server_state_);
|
| local_state_->SetInteger(prefs::kAutoEnrollmentPowerLimit, power_limit_);
|
| local_state_->CommitPendingWrite();
|
| - VLOG(1) << "Auto enrollment check complete, has_server_state_ = "
|
| - << has_server_state_;
|
| + VLOG(1) << "Received has_state=" << has_server_state_;
|
| progress = true;
|
| }
|
|
|
| @@ -391,7 +397,7 @@ bool AutoEnrollmentClient::OnDeviceStateRequestCompletion(
|
| state_response.disabled_state().message()));
|
|
|
| // Logging as "WARNING" to make sure it's preserved in the logs.
|
| - LOG(WARNING) << "Restore mode: " << restore_mode;
|
| + LOG(WARNING) << "Received restore_mode=" << state_response.restore_mode();
|
| }
|
| local_state_->CommitPendingWrite();
|
| device_state_available_ = true;
|
|
|