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

Side by Side Diff: chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 enrollment_step_ = STEP_STORE_POLICY; 291 enrollment_step_ = STEP_STORE_POLICY;
292 store_->InstallInitialPolicy(*policy_); 292 store_->InstallInitialPolicy(*policy_);
293 return; 293 return;
294 case EnterpriseInstallAttributes::LOCK_NOT_READY: 294 case EnterpriseInstallAttributes::LOCK_NOT_READY:
295 // We wait up to |kLockRetryTimeoutMs| milliseconds and if it hasn't 295 // We wait up to |kLockRetryTimeoutMs| milliseconds and if it hasn't
296 // succeeded by then show an error to the user and stop the enrollment. 296 // succeeded by then show an error to the user and stop the enrollment.
297 if (lockbox_init_duration_ < kLockRetryTimeoutMs) { 297 if (lockbox_init_duration_ < kLockRetryTimeoutMs) {
298 // InstallAttributes not ready yet, retry later. 298 // InstallAttributes not ready yet, retry later.
299 LOG(WARNING) << "Install Attributes not ready yet will retry in " 299 LOG(WARNING) << "Install Attributes not ready yet will retry in "
300 << kLockRetryIntervalMs << "ms."; 300 << kLockRetryIntervalMs << "ms.";
301 MessageLoop::current()->PostDelayedTask( 301 base::MessageLoop::current()->PostDelayedTask(
302 FROM_HERE, 302 FROM_HERE,
303 base::Bind(&EnrollmentHandlerChromeOS::StartLockDevice, 303 base::Bind(&EnrollmentHandlerChromeOS::StartLockDevice,
304 weak_factory_.GetWeakPtr(), 304 weak_factory_.GetWeakPtr(),
305 user, device_mode, device_id), 305 user, device_mode, device_id),
306 base::TimeDelta::FromMilliseconds(kLockRetryIntervalMs)); 306 base::TimeDelta::FromMilliseconds(kLockRetryIntervalMs));
307 lockbox_init_duration_ += kLockRetryIntervalMs; 307 lockbox_init_duration_ += kLockRetryIntervalMs;
308 } else { 308 } else {
309 ReportResult(EnrollmentStatus::ForStatus( 309 ReportResult(EnrollmentStatus::ForStatus(
310 EnrollmentStatus::STATUS_LOCK_TIMEOUT)); 310 EnrollmentStatus::STATUS_LOCK_TIMEOUT));
311 } 311 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 << " " << status.client_status() 344 << " " << status.client_status()
345 << " " << status.validation_status() 345 << " " << status.validation_status()
346 << " " << status.store_status(); 346 << " " << status.store_status();
347 } 347 }
348 348
349 if (!callback.is_null()) 349 if (!callback.is_null())
350 callback.Run(status); 350 callback.Run(status);
351 } 351 }
352 352
353 } // namespace policy 353 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698