| 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/policy/policy_builder.h" | 5 #include "chrome/browser/policy/policy_builder.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 const char PolicyBuilder::kFakeDomain[] = "example.com"; | 91 const char PolicyBuilder::kFakeDomain[] = "example.com"; |
| 92 const char PolicyBuilder::kFakeMachineName[] = "machine-name"; | 92 const char PolicyBuilder::kFakeMachineName[] = "machine-name"; |
| 93 const char PolicyBuilder::kFakePolicyType[] = "policy type"; | 93 const char PolicyBuilder::kFakePolicyType[] = "policy type"; |
| 94 const int PolicyBuilder::kFakePublicKeyVersion = 17; | 94 const int PolicyBuilder::kFakePublicKeyVersion = 17; |
| 95 const int64 PolicyBuilder::kFakeTimestamp = 365LL * 24 * 60 * 60 * 1000; | 95 const int64 PolicyBuilder::kFakeTimestamp = 365LL * 24 * 60 * 60 * 1000; |
| 96 const char PolicyBuilder::kFakeToken[] = "token"; | 96 const char PolicyBuilder::kFakeToken[] = "token"; |
| 97 const char PolicyBuilder::kFakeUsername[] = "username@example.com"; | 97 const char PolicyBuilder::kFakeUsername[] = "username@example.com"; |
| 98 | 98 |
| 99 PolicyBuilder::PolicyBuilder() | 99 PolicyBuilder::PolicyBuilder() |
| 100 : policy_data_(new em::PolicyData()), | 100 : policy_data_(new em::PolicyData()), |
| 101 signing_key_(CreateTestSigningKey()), | 101 signing_key_(CreateTestSigningKey()) { |
| 102 new_signing_key_(CreateTestNewSigningKey()) { | |
| 103 policy_data_->set_policy_type(kFakePolicyType); | 102 policy_data_->set_policy_type(kFakePolicyType); |
| 104 policy_data_->set_timestamp(kFakeTimestamp); | 103 policy_data_->set_timestamp(kFakeTimestamp); |
| 105 policy_data_->set_request_token(kFakeToken); | 104 policy_data_->set_request_token(kFakeToken); |
| 106 policy_data_->set_machine_name(kFakeMachineName); | 105 policy_data_->set_machine_name(kFakeMachineName); |
| 107 policy_data_->set_public_key_version(kFakePublicKeyVersion); | 106 policy_data_->set_public_key_version(kFakePublicKeyVersion); |
| 108 policy_data_->set_username(kFakeUsername); | 107 policy_data_->set_username(kFakeUsername); |
| 109 policy_data_->set_device_id(kFakeDeviceId); | 108 policy_data_->set_device_id(kFakeDeviceId); |
| 110 policy_data_->set_state(em::PolicyData::ACTIVE); | 109 policy_data_->set_state(em::PolicyData::ACTIVE); |
| 111 } | 110 } |
| 112 | 111 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 CHECK(payload_->SerializeToString(policy_data().mutable_policy_value())); | 205 CHECK(payload_->SerializeToString(policy_data().mutable_policy_value())); |
| 207 | 206 |
| 208 PolicyBuilder::Build(); | 207 PolicyBuilder::Build(); |
| 209 } | 208 } |
| 210 | 209 |
| 211 // Have the instantiations compiled into the module. | 210 // Have the instantiations compiled into the module. |
| 212 template class TypedPolicyBuilder<em::CloudPolicySettings>; | 211 template class TypedPolicyBuilder<em::CloudPolicySettings>; |
| 213 template class TypedPolicyBuilder<em::ChromeDeviceSettingsProto>; | 212 template class TypedPolicyBuilder<em::ChromeDeviceSettingsProto>; |
| 214 | 213 |
| 215 } // namespace policy | 214 } // namespace policy |
| OLD | NEW |