| 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 2a54a10fce20e4f6e6762d0b1fde5a047ef12e27..986356fdd6a2c14502db04d63605a5e6d7038cab 100644
|
| --- a/chrome/browser/chromeos/policy/auto_enrollment_client.cc
|
| +++ b/chrome/browser/chromeos/policy/auto_enrollment_client.cc
|
| @@ -79,7 +79,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();
|
| }
|
|
|
| @@ -191,6 +191,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_) {
|
| @@ -223,11 +224,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;
|
| }
|
| }
|
|
|
| @@ -243,6 +248,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,
|
| @@ -261,6 +267,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,
|
| @@ -354,8 +361,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;
|
| }
|
|
|
| @@ -390,7 +396,7 @@ bool AutoEnrollmentClient::OnDeviceStateRequestCompletion(
|
| new base::Value(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;
|
|
|