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

Side by Side Diff: chrome/browser/chromeos/policy/device_local_account_policy_store.cc

Issue 19733003: Implement cloud policy invalidations using the invalidation service framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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
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/chromeos/policy/device_local_account_policy_store.h" 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_store.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/policy/cloud/device_management_service.h" 10 #include "chrome/browser/policy/cloud/device_management_service.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 void DeviceLocalAccountPolicyStore::UpdatePolicy( 70 void DeviceLocalAccountPolicyStore::UpdatePolicy(
71 UserCloudPolicyValidator* validator) { 71 UserCloudPolicyValidator* validator) {
72 validation_status_ = validator->status(); 72 validation_status_ = validator->status();
73 if (!validator->success()) { 73 if (!validator->success()) {
74 status_ = STATUS_VALIDATION_ERROR; 74 status_ = STATUS_VALIDATION_ERROR;
75 NotifyStoreError(); 75 NotifyStoreError();
76 return; 76 return;
77 } 77 }
78 78
79 InstallPolicy(validator->policy_data().Pass(), validator->payload().Pass()); 79 InstallPolicy(
80 validator->policy_data().Pass(),
81 validator->payload().Pass(),
82 validator->hash_value());
Joao da Silva 2013/07/23 20:44:47 See comments in CloudPolicyStore: if the hash is c
Steve Condie 2013/07/24 01:42:04 Done.
80 // Exit the session when the lid is closed. The default behavior is to 83 // Exit the session when the lid is closed. The default behavior is to
81 // suspend while leaving the session running, which is not desirable for 84 // suspend while leaving the session running, which is not desirable for
82 // public sessions. 85 // public sessions.
83 policy_map_.Set(key::kLidCloseAction, 86 policy_map_.Set(key::kLidCloseAction,
84 POLICY_LEVEL_MANDATORY, 87 POLICY_LEVEL_MANDATORY,
85 POLICY_SCOPE_USER, 88 POLICY_SCOPE_USER,
86 base::Value::CreateIntegerValue( 89 base::Value::CreateIntegerValue(
87 chromeos::PowerPolicyController::ACTION_STOP_SESSION), 90 chromeos::PowerPolicyController::ACTION_STOP_SESSION),
88 NULL); 91 NULL);
89 92
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 validator->ValidateAgainstCurrentPolicy( 183 validator->ValidateAgainstCurrentPolicy(
181 policy(), 184 policy(),
182 CloudPolicyValidatorBase::TIMESTAMP_REQUIRED, 185 CloudPolicyValidatorBase::TIMESTAMP_REQUIRED,
183 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED); 186 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED);
184 validator->ValidatePayload(); 187 validator->ValidatePayload();
185 validator->ValidateSignature(*key->public_key(), false); 188 validator->ValidateSignature(*key->public_key(), false);
186 validator.release()->StartValidation(callback); 189 validator.release()->StartValidation(callback);
187 } 190 }
188 191
189 } // namespace policy 192 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698