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/cloud_policy_service.h" | 5 #include "chrome/browser/policy/cloud/cloud_policy_service.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" | 8 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" |
9 | 9 |
10 namespace em = enterprise_management; | 10 namespace em = enterprise_management; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 void CloudPolicyService::OnPolicyFetched(CloudPolicyClient* client) { | 61 void CloudPolicyService::OnPolicyFetched(CloudPolicyClient* client) { |
62 if (client_->status() != DM_STATUS_SUCCESS) { | 62 if (client_->status() != DM_STATUS_SUCCESS) { |
63 RefreshCompleted(false); | 63 RefreshCompleted(false); |
64 return; | 64 return; |
65 } | 65 } |
66 | 66 |
67 const em::PolicyFetchResponse* policy = client_->GetPolicyFor(policy_ns_key_); | 67 const em::PolicyFetchResponse* policy = client_->GetPolicyFor(policy_ns_key_); |
68 if (policy) { | 68 if (policy) { |
69 if (refresh_state_ != REFRESH_NONE) | 69 if (refresh_state_ != REFRESH_NONE) |
70 refresh_state_ = REFRESH_POLICY_STORE; | 70 refresh_state_ = REFRESH_POLICY_STORE; |
71 store_->set_invalidation_version(client->fetched_invalidation_version()); | |
Joao da Silva
2013/07/23 20:44:47
It'd be nicer to pass this value in the Store() ca
Steve Condie
2013/07/24 01:42:04
Done.
| |
71 store_->Store(*policy); | 72 store_->Store(*policy); |
72 } else { | 73 } else { |
73 RefreshCompleted(false); | 74 RefreshCompleted(false); |
74 } | 75 } |
75 } | 76 } |
76 | 77 |
77 void CloudPolicyService::OnRegistrationStateChanged(CloudPolicyClient* client) { | 78 void CloudPolicyService::OnRegistrationStateChanged(CloudPolicyClient* client) { |
78 } | 79 } |
79 | 80 |
80 void CloudPolicyService::OnClientError(CloudPolicyClient* client) { | 81 void CloudPolicyService::OnClientError(CloudPolicyClient* client) { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 | 152 |
152 void CloudPolicyService::AddObserver(Observer* observer) { | 153 void CloudPolicyService::AddObserver(Observer* observer) { |
153 observers_.AddObserver(observer); | 154 observers_.AddObserver(observer); |
154 } | 155 } |
155 | 156 |
156 void CloudPolicyService::RemoveObserver(Observer* observer) { | 157 void CloudPolicyService::RemoveObserver(Observer* observer) { |
157 observers_.RemoveObserver(observer); | 158 observers_.RemoveObserver(observer); |
158 } | 159 } |
159 | 160 |
160 } // namespace policy | 161 } // namespace policy |
OLD | NEW |