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/guid.h" | 8 #include "base/guid.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 | 220 |
221 // Fire the job. | 221 // Fire the job. |
222 request_job_->Start(base::Bind(&CloudPolicyClient::OnPolicyFetchCompleted, | 222 request_job_->Start(base::Bind(&CloudPolicyClient::OnPolicyFetchCompleted, |
223 base::Unretained(this))); | 223 base::Unretained(this))); |
224 } | 224 } |
225 | 225 |
226 void CloudPolicyClient::FetchRobotAuthCodes(const std::string& auth_token) { | 226 void CloudPolicyClient::FetchRobotAuthCodes(const std::string& auth_token) { |
227 CHECK(is_registered()); | 227 CHECK(is_registered()); |
228 DCHECK(!auth_token.empty()); | 228 DCHECK(!auth_token.empty()); |
229 | 229 |
230 request_job_.reset(service_->CreateJob( | 230 request_job_.reset( |
231 DeviceManagementRequestJob::TYPE_API_AUTH_CODE_FETCH, | 231 service_->CreateJob(DeviceManagementRequestJob::TYPE_API_AUTH_CODE_FETCH, |
bartfab (slow)
2014/08/29 09:42:38
Nit: Why did this get reformatted? I see no code c
dcheng
2014/08/29 09:56:37
I've reverted this change. It's because the line w
| |
232 GetRequestContext())); | 232 GetRequestContext())); |
233 // The credentials of a domain user are needed in order to mint a new OAuth2 | 233 // The credentials of a domain user are needed in order to mint a new OAuth2 |
234 // authorization token for the robot account. | 234 // authorization token for the robot account. |
235 request_job_->SetOAuthToken(auth_token); | 235 request_job_->SetOAuthToken(auth_token); |
236 request_job_->SetDMToken(dm_token_); | 236 request_job_->SetDMToken(dm_token_); |
237 request_job_->SetClientID(client_id_); | 237 request_job_->SetClientID(client_id_); |
238 | 238 |
239 em::DeviceServiceApiAccessRequest* request = | 239 em::DeviceServiceApiAccessRequest* request = |
240 request_job_->GetRequest()->mutable_service_api_access_request(); | 240 request_job_->GetRequest()->mutable_service_api_access_request(); |
241 request->set_oauth2_client_id( | 241 request->set_oauth2_client_id( |
242 GaiaUrls::GetInstance()->oauth2_chrome_client_id()); | 242 GaiaUrls::GetInstance()->oauth2_chrome_client_id()); |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
470 | 470 |
471 void CloudPolicyClient::NotifyRobotAuthCodesFetched() { | 471 void CloudPolicyClient::NotifyRobotAuthCodesFetched() { |
472 FOR_EACH_OBSERVER(Observer, observers_, OnRobotAuthCodesFetched(this)); | 472 FOR_EACH_OBSERVER(Observer, observers_, OnRobotAuthCodesFetched(this)); |
473 } | 473 } |
474 | 474 |
475 void CloudPolicyClient::NotifyClientError() { | 475 void CloudPolicyClient::NotifyClientError() { |
476 FOR_EACH_OBSERVER(Observer, observers_, OnClientError(this)); | 476 FOR_EACH_OBSERVER(Observer, observers_, OnClientError(this)); |
477 } | 477 } |
478 | 478 |
479 } // namespace policy | 479 } // namespace policy |
OLD | NEW |