| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" | 10 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 enrollment_step_ = STEP_STORE_POLICY; | 200 enrollment_step_ = STEP_STORE_POLICY; |
| 201 store_->InstallInitialPolicy(*policy_); | 201 store_->InstallInitialPolicy(*policy_); |
| 202 return; | 202 return; |
| 203 case EnterpriseInstallAttributes::LOCK_NOT_READY: | 203 case EnterpriseInstallAttributes::LOCK_NOT_READY: |
| 204 // We wait up to |kLockRetryTimeoutMs| milliseconds and if it hasn't | 204 // We wait up to |kLockRetryTimeoutMs| milliseconds and if it hasn't |
| 205 // succeeded by then show an error to the user and stop the enrollment. | 205 // succeeded by then show an error to the user and stop the enrollment. |
| 206 if (lockbox_init_duration_ < kLockRetryTimeoutMs) { | 206 if (lockbox_init_duration_ < kLockRetryTimeoutMs) { |
| 207 // InstallAttributes not ready yet, retry later. | 207 // InstallAttributes not ready yet, retry later. |
| 208 LOG(WARNING) << "Install Attributes not ready yet will retry in " | 208 LOG(WARNING) << "Install Attributes not ready yet will retry in " |
| 209 << kLockRetryIntervalMs << "ms."; | 209 << kLockRetryIntervalMs << "ms."; |
| 210 MessageLoop::current()->PostDelayedTask( | 210 base::MessageLoop::current()->PostDelayedTask( |
| 211 FROM_HERE, | 211 FROM_HERE, |
| 212 base::Bind(&EnrollmentHandlerChromeOS::WriteInstallAttributes, | 212 base::Bind(&EnrollmentHandlerChromeOS::WriteInstallAttributes, |
| 213 weak_factory_.GetWeakPtr(), | 213 weak_factory_.GetWeakPtr(), |
| 214 user, device_mode, device_id), | 214 user, |
| 215 device_mode, |
| 216 device_id), |
| 215 base::TimeDelta::FromMilliseconds(kLockRetryIntervalMs)); | 217 base::TimeDelta::FromMilliseconds(kLockRetryIntervalMs)); |
| 216 lockbox_init_duration_ += kLockRetryIntervalMs; | 218 lockbox_init_duration_ += kLockRetryIntervalMs; |
| 217 } else { | 219 } else { |
| 218 ReportResult(EnrollmentStatus::ForStatus( | 220 ReportResult(EnrollmentStatus::ForStatus( |
| 219 EnrollmentStatus::STATUS_LOCK_TIMEOUT)); | 221 EnrollmentStatus::STATUS_LOCK_TIMEOUT)); |
| 220 } | 222 } |
| 221 return; | 223 return; |
| 222 case EnterpriseInstallAttributes::LOCK_BACKEND_ERROR: | 224 case EnterpriseInstallAttributes::LOCK_BACKEND_ERROR: |
| 223 ReportResult(EnrollmentStatus::ForStatus( | 225 ReportResult(EnrollmentStatus::ForStatus( |
| 224 EnrollmentStatus::STATUS_LOCK_ERROR)); | 226 EnrollmentStatus::STATUS_LOCK_ERROR)); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 253 << " " << status.client_status() | 255 << " " << status.client_status() |
| 254 << " " << status.validation_status() | 256 << " " << status.validation_status() |
| 255 << " " << status.store_status(); | 257 << " " << status.store_status(); |
| 256 } | 258 } |
| 257 | 259 |
| 258 if (!callback.is_null()) | 260 if (!callback.is_null()) |
| 259 callback.Run(status); | 261 callback.Run(status); |
| 260 } | 262 } |
| 261 | 263 |
| 262 } // namespace policy | 264 } // namespace policy |
| OLD | NEW |