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/cloud/user_cloud_policy_store_base.h" | 5 #include "chrome/browser/policy/cloud/user_cloud_policy_store_base.h" |
6 | 6 |
7 #include "chrome/browser/policy/cloud/cloud_external_data_manager.h" | 7 #include "chrome/browser/policy/cloud/cloud_external_data_manager.h" |
8 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" | 8 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" |
9 #include "chrome/browser/policy/policy_map.h" | 9 #include "components/policy/core/common/policy_map.h" |
10 #include "policy/proto/cloud_policy.pb.h" | 10 #include "policy/proto/cloud_policy.pb.h" |
11 | 11 |
12 namespace policy { | 12 namespace policy { |
13 | 13 |
14 // Decodes a CloudPolicySettings object into a policy map. The implementation is | 14 // Decodes a CloudPolicySettings object into a policy map. The implementation is |
15 // generated code in policy/cloud_policy_generated.cc. | 15 // generated code in policy/cloud_policy_generated.cc. |
16 void DecodePolicy(const enterprise_management::CloudPolicySettings& policy, | 16 void DecodePolicy(const enterprise_management::CloudPolicySettings& policy, |
17 base::WeakPtr<CloudExternalDataManager> external_data_manager, | 17 base::WeakPtr<CloudExternalDataManager> external_data_manager, |
18 PolicyMap* policies); | 18 PolicyMap* policies); |
19 | 19 |
(...skipping 22 matching lines...) Expand all Loading... |
42 void UserCloudPolicyStoreBase::InstallPolicy( | 42 void UserCloudPolicyStoreBase::InstallPolicy( |
43 scoped_ptr<enterprise_management::PolicyData> policy_data, | 43 scoped_ptr<enterprise_management::PolicyData> policy_data, |
44 scoped_ptr<enterprise_management::CloudPolicySettings> payload) { | 44 scoped_ptr<enterprise_management::CloudPolicySettings> payload) { |
45 // Decode the payload. | 45 // Decode the payload. |
46 policy_map_.Clear(); | 46 policy_map_.Clear(); |
47 DecodePolicy(*payload, external_data_manager(), &policy_map_); | 47 DecodePolicy(*payload, external_data_manager(), &policy_map_); |
48 policy_ = policy_data.Pass(); | 48 policy_ = policy_data.Pass(); |
49 } | 49 } |
50 | 50 |
51 } // namespace policy | 51 } // namespace policy |
OLD | NEW |