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

Side by Side Diff: chrome/browser/policy/cloud/cloud_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 "base/logging.h"
5 #include "chrome/browser/policy/cloud/cloud_policy_store.h" 6 #include "chrome/browser/policy/cloud/cloud_policy_store.h"
6 7
7 namespace policy { 8 namespace policy {
8 9
9 CloudPolicyStore::Observer::~Observer() {} 10 CloudPolicyStore::Observer::~Observer() {}
10 11
11 CloudPolicyStore::CloudPolicyStore() 12 CloudPolicyStore::CloudPolicyStore()
12 : status_(STATUS_OK), 13 : status_(STATUS_OK),
13 validation_status_(CloudPolicyValidatorBase::VALIDATION_OK), 14 validation_status_(CloudPolicyValidatorBase::VALIDATION_OK),
14 is_initialized_(false) {} 15 is_initialized_(false),
16 hash_value_(0),
17 policy_changed_(false),
18 invalidation_version_(0) {}
15 19
16 CloudPolicyStore::~CloudPolicyStore() {} 20 CloudPolicyStore::~CloudPolicyStore() {}
17 21
18 void CloudPolicyStore::AddObserver(CloudPolicyStore::Observer* observer) { 22 void CloudPolicyStore::AddObserver(CloudPolicyStore::Observer* observer) {
19 observers_.AddObserver(observer); 23 observers_.AddObserver(observer);
20 } 24 }
21 25
22 void CloudPolicyStore::RemoveObserver(CloudPolicyStore::Observer* observer) { 26 void CloudPolicyStore::RemoveObserver(CloudPolicyStore::Observer* observer) {
23 observers_.RemoveObserver(observer); 27 observers_.RemoveObserver(observer);
24 } 28 }
25 29
26 void CloudPolicyStore::NotifyStoreLoaded() { 30 void CloudPolicyStore::NotifyStoreLoaded() {
27 is_initialized_ = true; 31 is_initialized_ = true;
28 FOR_EACH_OBSERVER(Observer, observers_, OnStoreLoaded(this)); 32 FOR_EACH_OBSERVER(Observer, observers_, OnStoreLoaded(this));
29 } 33 }
30 34
31 void CloudPolicyStore::NotifyStoreError() { 35 void CloudPolicyStore::NotifyStoreError() {
32 is_initialized_ = true; 36 is_initialized_ = true;
33 FOR_EACH_OBSERVER(Observer, observers_, OnStoreError(this)); 37 FOR_EACH_OBSERVER(Observer, observers_, OnStoreError(this));
34 } 38 }
35 39
36 } // namespace 40 void CloudPolicyStore::SetPolicyHashValue(uint32 hash_value) {
41 policy_changed_ = hash_value != hash_value_;
42 hash_value_ = hash_value;
43 }
44
45 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698