OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/login/enrollment/enterprise_enrollment_screen. h" | 5 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen. 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/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 void EnterpriseEnrollmentScreen::WriteInstallAttributesData() { | 279 void EnterpriseEnrollmentScreen::WriteInstallAttributesData() { |
280 // Since this method is also called directly. | 280 // Since this method is also called directly. |
281 weak_ptr_factory_.InvalidateWeakPtrs(); | 281 weak_ptr_factory_.InvalidateWeakPtrs(); |
282 | 282 |
283 switch (g_browser_process->browser_policy_connector()->LockDevice(user_)) { | 283 switch (g_browser_process->browser_policy_connector()->LockDevice(user_)) { |
284 case policy::EnterpriseInstallAttributes::LOCK_SUCCESS: { | 284 case policy::EnterpriseInstallAttributes::LOCK_SUCCESS: { |
285 actor_->SetEditableUser(false); | 285 actor_->SetEditableUser(false); |
286 // Proceed with policy fetch. | 286 // Proceed with policy fetch. |
287 policy::BrowserPolicyConnector* connector = | 287 policy::BrowserPolicyConnector* connector = |
288 g_browser_process->browser_policy_connector(); | 288 g_browser_process->browser_policy_connector(); |
289 connector->FetchDevicePolicy(); | 289 connector->FetchCloudPolicy(); |
Mattias Nissler (ping if slow)
2011/11/18 14:49:32
This is not quite what we want, but user policy sh
| |
290 return; | 290 return; |
291 } | 291 } |
292 case policy::EnterpriseInstallAttributes::LOCK_NOT_READY: { | 292 case policy::EnterpriseInstallAttributes::LOCK_NOT_READY: { |
293 // InstallAttributes not ready yet, retry later. | 293 // InstallAttributes not ready yet, retry later. |
294 LOG(WARNING) << "Install Attributes not ready yet will retry in " | 294 LOG(WARNING) << "Install Attributes not ready yet will retry in " |
295 << kLockRetryIntervalMs << "ms."; | 295 << kLockRetryIntervalMs << "ms."; |
296 MessageLoop::current()->PostDelayedTask( | 296 MessageLoop::current()->PostDelayedTask( |
297 FROM_HERE, | 297 FROM_HERE, |
298 base::Bind(&EnterpriseEnrollmentScreen::WriteInstallAttributesData, | 298 base::Bind(&EnterpriseEnrollmentScreen::WriteInstallAttributesData, |
299 weak_ptr_factory_.GetWeakPtr()), | 299 weak_ptr_factory_.GetWeakPtr()), |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
333 connector->ScheduleServiceInitialization(0); | 333 connector->ScheduleServiceInitialization(0); |
334 registrar_.reset(new policy::CloudPolicySubsystem::ObserverRegistrar( | 334 registrar_.reset(new policy::CloudPolicySubsystem::ObserverRegistrar( |
335 connector->device_cloud_policy_subsystem(), this)); | 335 connector->device_cloud_policy_subsystem(), this)); |
336 | 336 |
337 // Push the credentials to the policy infrastructure. It'll start enrollment | 337 // Push the credentials to the policy infrastructure. It'll start enrollment |
338 // and notify us of progress through CloudPolicySubsystem::Observer. | 338 // and notify us of progress through CloudPolicySubsystem::Observer. |
339 connector->RegisterForDevicePolicy(user_, token, token_type); | 339 connector->RegisterForDevicePolicy(user_, token, token_type); |
340 } | 340 } |
341 | 341 |
342 } // namespace chromeos | 342 } // namespace chromeos |
OLD | NEW |