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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 background_task_runner_)); | 108 background_task_runner_)); |
109 | 109 |
110 validator->ValidateTimestamp(base::Time(), base::Time::NowFromSystemTime(), | 110 validator->ValidateTimestamp(base::Time(), base::Time::NowFromSystemTime(), |
111 CloudPolicyValidatorBase::TIMESTAMP_REQUIRED); | 111 CloudPolicyValidatorBase::TIMESTAMP_REQUIRED); |
112 if (install_attributes_->IsEnterpriseDevice()) | 112 if (install_attributes_->IsEnterpriseDevice()) |
113 validator->ValidateDomain(install_attributes_->GetDomain()); | 113 validator->ValidateDomain(install_attributes_->GetDomain()); |
114 validator->ValidateDMToken(client->dm_token(), | 114 validator->ValidateDMToken(client->dm_token(), |
115 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED); | 115 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED); |
116 validator->ValidatePolicyType(dm_protocol::kChromeDevicePolicyType); | 116 validator->ValidatePolicyType(dm_protocol::kChromeDevicePolicyType); |
117 validator->ValidatePayload(); | 117 validator->ValidatePayload(); |
118 validator->ValidateInitialKey(); | 118 validator->ValidateInitialKey(GetPolicyVerificationKey()); |
119 validator.release()->StartValidation( | 119 validator.release()->StartValidation( |
120 base::Bind(&EnrollmentHandlerChromeOS::PolicyValidated, | 120 base::Bind(&EnrollmentHandlerChromeOS::PolicyValidated, |
121 weak_ptr_factory_.GetWeakPtr())); | 121 weak_ptr_factory_.GetWeakPtr())); |
122 } | 122 } |
123 | 123 |
124 void EnrollmentHandlerChromeOS::OnRegistrationStateChanged( | 124 void EnrollmentHandlerChromeOS::OnRegistrationStateChanged( |
125 CloudPolicyClient* client) { | 125 CloudPolicyClient* client) { |
126 DCHECK_EQ(client_.get(), client); | 126 DCHECK_EQ(client_.get(), client); |
127 | 127 |
128 if (enrollment_step_ == STEP_REGISTRATION && client_->is_registered()) { | 128 if (enrollment_step_ == STEP_REGISTRATION && client_->is_registered()) { |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 << " " << status.client_status() | 379 << " " << status.client_status() |
380 << " " << status.validation_status() | 380 << " " << status.validation_status() |
381 << " " << status.store_status(); | 381 << " " << status.store_status(); |
382 } | 382 } |
383 | 383 |
384 if (!callback.is_null()) | 384 if (!callback.is_null()) |
385 callback.Run(status); | 385 callback.Run(status); |
386 } | 386 } |
387 | 387 |
388 } // namespace policy | 388 } // namespace policy |
OLD | NEW |