Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: chrome/browser/policy/cloud/user_cloud_policy_store_base.cc

Issue 24041002: Turn off future-timestamp cloud policy checks on desktop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed enum name to TIMESTAMP_NOT_BEFORE Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/policy/cloud/user_cloud_policy_store_base.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/policy/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
20 UserCloudPolicyStoreBase::UserCloudPolicyStoreBase() { 20 UserCloudPolicyStoreBase::UserCloudPolicyStoreBase() {
21 } 21 }
22 22
23 UserCloudPolicyStoreBase::~UserCloudPolicyStoreBase() { 23 UserCloudPolicyStoreBase::~UserCloudPolicyStoreBase() {
24 } 24 }
25 25
26 scoped_ptr<UserCloudPolicyValidator> UserCloudPolicyStoreBase::CreateValidator( 26 scoped_ptr<UserCloudPolicyValidator> UserCloudPolicyStoreBase::CreateValidator(
27 scoped_ptr<enterprise_management::PolicyFetchResponse> policy) { 27 scoped_ptr<enterprise_management::PolicyFetchResponse> policy,
28 CloudPolicyValidatorBase::ValidateTimestampOption timestamp_option) {
28 // Configure the validator. 29 // Configure the validator.
29 UserCloudPolicyValidator* validator = 30 UserCloudPolicyValidator* validator =
30 UserCloudPolicyValidator::Create(policy.Pass()); 31 UserCloudPolicyValidator::Create(policy.Pass());
31 validator->ValidatePolicyType(GetChromeUserPolicyType()); 32 validator->ValidatePolicyType(GetChromeUserPolicyType());
32 validator->ValidateAgainstCurrentPolicy( 33 validator->ValidateAgainstCurrentPolicy(
33 policy_.get(), 34 policy_.get(),
34 CloudPolicyValidatorBase::TIMESTAMP_REQUIRED, 35 timestamp_option,
35 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED); 36 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED);
36 validator->ValidatePayload(); 37 validator->ValidatePayload();
37 return scoped_ptr<UserCloudPolicyValidator>(validator); 38 return scoped_ptr<UserCloudPolicyValidator>(validator);
38 } 39 }
39 40
40 void UserCloudPolicyStoreBase::InstallPolicy( 41 void UserCloudPolicyStoreBase::InstallPolicy(
41 scoped_ptr<enterprise_management::PolicyData> policy_data, 42 scoped_ptr<enterprise_management::PolicyData> policy_data,
42 scoped_ptr<enterprise_management::CloudPolicySettings> payload) { 43 scoped_ptr<enterprise_management::CloudPolicySettings> payload) {
43 // Decode the payload. 44 // Decode the payload.
44 policy_map_.Clear(); 45 policy_map_.Clear();
45 DecodePolicy(*payload, external_data_manager(), &policy_map_); 46 DecodePolicy(*payload, external_data_manager(), &policy_map_);
46 policy_ = policy_data.Pass(); 47 policy_ = policy_data.Pass();
47 } 48 }
48 49
49 } // namespace policy 50 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/cloud/user_cloud_policy_store_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698