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 "components/policy/core/common/cloud/policy_builder.h" | 5 #include "components/policy/core/common/cloud/policy_builder.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "chrome/browser/policy/proto/cloud/chrome_extension_policy.pb.h" | |
11 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 10 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
12 #include "crypto/signature_creator.h" | 11 #include "crypto/signature_creator.h" |
13 #include "policy/proto/cloud_policy.pb.h" | |
14 | 12 |
15 namespace em = enterprise_management; | 13 namespace em = enterprise_management; |
16 | 14 |
17 namespace policy { | 15 namespace policy { |
18 | 16 |
19 namespace { | 17 namespace { |
20 | 18 |
21 // Signing key test data in DER-encoded PKCS8 format. | 19 // Signing key test data in DER-encoded PKCS8 format. |
22 const uint8 kSigningKey[] = { | 20 const uint8 kSigningKey[] = { |
23 0x30, 0x82, 0x01, 0x55, 0x02, 0x01, 0x00, 0x30, 0x0d, 0x06, 0x09, 0x2a, | 21 0x30, 0x82, 0x01, 0x55, 0x02, 0x01, 0x00, 0x30, 0x0d, 0x06, 0x09, 0x2a, |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 reinterpret_cast<const char*>(vector_as_array(&signature_bytes)), | 218 reinterpret_cast<const char*>(vector_as_array(&signature_bytes)), |
221 signature_bytes.size()); | 219 signature_bytes.size()); |
222 } | 220 } |
223 | 221 |
224 template<> | 222 template<> |
225 TypedPolicyBuilder<em::CloudPolicySettings>::TypedPolicyBuilder() | 223 TypedPolicyBuilder<em::CloudPolicySettings>::TypedPolicyBuilder() |
226 : payload_(new em::CloudPolicySettings()) { | 224 : payload_(new em::CloudPolicySettings()) { |
227 policy_data().set_policy_type(dm_protocol::kChromeUserPolicyType); | 225 policy_data().set_policy_type(dm_protocol::kChromeUserPolicyType); |
228 } | 226 } |
229 | 227 |
| 228 // Have the instantiation compiled into the module. |
| 229 template class TypedPolicyBuilder<em::CloudPolicySettings>; |
| 230 |
| 231 #if !defined(OS_ANDROID) |
230 template<> | 232 template<> |
231 TypedPolicyBuilder<em::ExternalPolicyData>::TypedPolicyBuilder() | 233 TypedPolicyBuilder<em::ExternalPolicyData>::TypedPolicyBuilder() |
232 : payload_(new em::ExternalPolicyData()) { | 234 : payload_(new em::ExternalPolicyData()) { |
233 policy_data().set_policy_type(dm_protocol::kChromeExtensionPolicyType); | 235 policy_data().set_policy_type(dm_protocol::kChromeExtensionPolicyType); |
234 } | 236 } |
235 | 237 |
236 | |
237 // Have the instantiations compiled into the module. | |
238 template class TypedPolicyBuilder<em::CloudPolicySettings>; | |
239 template class TypedPolicyBuilder<em::ExternalPolicyData>; | 238 template class TypedPolicyBuilder<em::ExternalPolicyData>; |
| 239 #endif |
240 | 240 |
241 } // namespace policy | 241 } // namespace policy |
OLD | NEW |