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/macros.h" | 9 #include "base/macros.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 253 } |
254 } | 254 } |
255 | 255 |
256 std::string PolicyBuilder::GetBlob() { | 256 std::string PolicyBuilder::GetBlob() { |
257 return policy_.SerializeAsString(); | 257 return policy_.SerializeAsString(); |
258 } | 258 } |
259 | 259 |
260 scoped_ptr<em::PolicyFetchResponse> PolicyBuilder::GetCopy() { | 260 scoped_ptr<em::PolicyFetchResponse> PolicyBuilder::GetCopy() { |
261 scoped_ptr<em::PolicyFetchResponse> result(new em::PolicyFetchResponse()); | 261 scoped_ptr<em::PolicyFetchResponse> result(new em::PolicyFetchResponse()); |
262 result->CopyFrom(policy_); | 262 result->CopyFrom(policy_); |
263 return result.Pass(); | 263 return result; |
264 } | 264 } |
265 | 265 |
266 // static | 266 // static |
267 scoped_ptr<crypto::RSAPrivateKey> PolicyBuilder::CreateTestSigningKey() { | 267 scoped_ptr<crypto::RSAPrivateKey> PolicyBuilder::CreateTestSigningKey() { |
268 std::vector<uint8_t> raw_signing_key(kSigningKey, | 268 std::vector<uint8_t> raw_signing_key(kSigningKey, |
269 kSigningKey + arraysize(kSigningKey)); | 269 kSigningKey + arraysize(kSigningKey)); |
270 return scoped_ptr<crypto::RSAPrivateKey>( | 270 return scoped_ptr<crypto::RSAPrivateKey>( |
271 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(raw_signing_key)); | 271 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(raw_signing_key)); |
272 } | 272 } |
273 | 273 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 template<> | 318 template<> |
319 TypedPolicyBuilder<em::ExternalPolicyData>::TypedPolicyBuilder() | 319 TypedPolicyBuilder<em::ExternalPolicyData>::TypedPolicyBuilder() |
320 : payload_(new em::ExternalPolicyData()) { | 320 : payload_(new em::ExternalPolicyData()) { |
321 policy_data().set_policy_type(dm_protocol::kChromeExtensionPolicyType); | 321 policy_data().set_policy_type(dm_protocol::kChromeExtensionPolicyType); |
322 } | 322 } |
323 | 323 |
324 template class TypedPolicyBuilder<em::ExternalPolicyData>; | 324 template class TypedPolicyBuilder<em::ExternalPolicyData>; |
325 #endif | 325 #endif |
326 | 326 |
327 } // namespace policy | 327 } // namespace policy |
OLD | NEW |