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 "components/policy/core/common/cloud/cloud_policy_client.h" | 5 #include "components/policy/core/common/cloud/cloud_policy_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 request->set_flavor(flavor); | 126 request->set_flavor(flavor); |
127 | 127 |
128 policy_fetch_request_job_->SetRetryCallback( | 128 policy_fetch_request_job_->SetRetryCallback( |
129 base::Bind(&CloudPolicyClient::OnRetryRegister, base::Unretained(this))); | 129 base::Bind(&CloudPolicyClient::OnRetryRegister, base::Unretained(this))); |
130 | 130 |
131 policy_fetch_request_job_->Start( | 131 policy_fetch_request_job_->Start( |
132 base::Bind(&CloudPolicyClient::OnRegisterCompleted, | 132 base::Bind(&CloudPolicyClient::OnRegisterCompleted, |
133 base::Unretained(this))); | 133 base::Unretained(this))); |
134 } | 134 } |
135 | 135 |
136 void CloudPolicyClient::SetInvalidationInfo( | 136 void CloudPolicyClient::SetInvalidationInfo(int64_t version, |
137 int64 version, | 137 const std::string& payload) { |
138 const std::string& payload) { | |
139 invalidation_version_ = version; | 138 invalidation_version_ = version; |
140 invalidation_payload_ = payload; | 139 invalidation_payload_ = payload; |
141 } | 140 } |
142 | 141 |
143 void CloudPolicyClient::FetchPolicy() { | 142 void CloudPolicyClient::FetchPolicy() { |
144 CHECK(is_registered()); | 143 CHECK(is_registered()); |
145 CHECK(!types_to_fetch_.empty()); | 144 CHECK(!types_to_fetch_.empty()); |
146 | 145 |
147 policy_fetch_request_job_.reset( | 146 policy_fetch_request_job_.reset( |
148 service_->CreateJob(DeviceManagementRequestJob::TYPE_POLICY_FETCH, | 147 service_->CreateJob(DeviceManagementRequestJob::TYPE_POLICY_FETCH, |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 | 712 |
714 void CloudPolicyClient::NotifyRobotAuthCodesFetched() { | 713 void CloudPolicyClient::NotifyRobotAuthCodesFetched() { |
715 FOR_EACH_OBSERVER(Observer, observers_, OnRobotAuthCodesFetched(this)); | 714 FOR_EACH_OBSERVER(Observer, observers_, OnRobotAuthCodesFetched(this)); |
716 } | 715 } |
717 | 716 |
718 void CloudPolicyClient::NotifyClientError() { | 717 void CloudPolicyClient::NotifyClientError() { |
719 FOR_EACH_OBSERVER(Observer, observers_, OnClientError(this)); | 718 FOR_EACH_OBSERVER(Observer, observers_, OnClientError(this)); |
720 } | 719 } |
721 | 720 |
722 } // namespace policy | 721 } // namespace policy |
OLD | NEW |