| 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 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_BUILDER_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_BUILDER_H_ |
| 6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_BUILDER_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_BUILDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "chrome/browser/policy/proto/cloud/chrome_extension_policy.pb.h" | |
| 15 #include "chrome/browser/policy/proto/cloud/device_management_local.pb.h" | |
| 16 #include "crypto/rsa_private_key.h" | 14 #include "crypto/rsa_private_key.h" |
| 17 #include "policy/proto/cloud_policy.pb.h" | 15 #include "policy/proto/cloud_policy.pb.h" |
| 16 #include "policy/proto/device_management_backend.pb.h" |
| 17 |
| 18 #if !defined(OS_ANDROID) |
| 19 #include "policy/proto/chrome_extension_policy.pb.h" |
| 20 #endif |
| 18 | 21 |
| 19 namespace policy { | 22 namespace policy { |
| 20 | 23 |
| 21 // A helper class for testing that provides a straightforward interface for | 24 // A helper class for testing that provides a straightforward interface for |
| 22 // constructing policy blobs for use in testing. NB: This uses fake data and | 25 // constructing policy blobs for use in testing. NB: This uses fake data and |
| 23 // hard-coded signing keys by default, so should not be used in production code. | 26 // hard-coded signing keys by default, so should not be used in production code. |
| 24 class PolicyBuilder { | 27 class PolicyBuilder { |
| 25 public: | 28 public: |
| 26 // Constants used as dummy data for filling the PolicyData protobuf. | 29 // Constants used as dummy data for filling the PolicyData protobuf. |
| 27 static const char kFakeDeviceId[]; | 30 static const char kFakeDeviceId[]; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 } | 128 } |
| 126 | 129 |
| 127 private: | 130 private: |
| 128 scoped_ptr<PayloadProto> payload_; | 131 scoped_ptr<PayloadProto> payload_; |
| 129 | 132 |
| 130 DISALLOW_COPY_AND_ASSIGN(TypedPolicyBuilder); | 133 DISALLOW_COPY_AND_ASSIGN(TypedPolicyBuilder); |
| 131 }; | 134 }; |
| 132 | 135 |
| 133 typedef TypedPolicyBuilder<enterprise_management::CloudPolicySettings> | 136 typedef TypedPolicyBuilder<enterprise_management::CloudPolicySettings> |
| 134 UserPolicyBuilder; | 137 UserPolicyBuilder; |
| 138 |
| 139 #if !defined(OS_ANDROID) |
| 135 typedef TypedPolicyBuilder<enterprise_management::ExternalPolicyData> | 140 typedef TypedPolicyBuilder<enterprise_management::ExternalPolicyData> |
| 136 ComponentPolicyBuilder; | 141 ComponentPolicyBuilder; |
| 142 #endif |
| 137 | 143 |
| 138 } // namespace policy | 144 } // namespace policy |
| 139 | 145 |
| 140 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_BUILDER_H_ | 146 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_BUILDER_H_ |
| OLD | NEW |