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

Side by Side Diff: components/policy/core/common/cloud/cloud_policy_client.cc

Issue 879233003: Initial RemoteCommandService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remote-commands
Patch Set: fix last_command_id Created 5 years, 10 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 "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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 request->mutable_cert_upload_request()->set_device_certificate( 269 request->mutable_cert_upload_request()->set_device_certificate(
270 certificate_data); 270 certificate_data);
271 271
272 DeviceManagementRequestJob::Callback job_callback = base::Bind( 272 DeviceManagementRequestJob::Callback job_callback = base::Bind(
273 &CloudPolicyClient::OnCertificateUploadCompleted, 273 &CloudPolicyClient::OnCertificateUploadCompleted,
274 base::Unretained(this), 274 base::Unretained(this),
275 callback); 275 callback);
276 request_job_->Start(job_callback); 276 request_job_->Start(job_callback);
277 } 277 }
278 278
279 scoped_ptr<DeviceManagementRequestJob>
280 CloudPolicyClient::CreateRemoteCommandsJob() {
281 CHECK(is_registered());
282 scoped_ptr<DeviceManagementRequestJob> job(service_->CreateJob(
283 DeviceManagementRequestJob::TYPE_REMOTE_COMMANDS, GetRequestContext()));
284 job->SetDMToken(dm_token_);
285 job->SetClientID(client_id_);
286
287 return job;
288 }
289
279 void CloudPolicyClient::AddObserver(Observer* observer) { 290 void CloudPolicyClient::AddObserver(Observer* observer) {
280 observers_.AddObserver(observer); 291 observers_.AddObserver(observer);
281 } 292 }
282 293
283 void CloudPolicyClient::RemoveObserver(Observer* observer) { 294 void CloudPolicyClient::RemoveObserver(Observer* observer) {
284 observers_.RemoveObserver(observer); 295 observers_.RemoveObserver(observer);
285 } 296 }
286 297
287 void CloudPolicyClient::SetStatusProvider(scoped_ptr<StatusProvider> provider) { 298 void CloudPolicyClient::SetStatusProvider(scoped_ptr<StatusProvider> provider) {
288 status_provider_ = provider.Pass(); 299 status_provider_ = provider.Pass();
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 491
481 void CloudPolicyClient::NotifyRobotAuthCodesFetched() { 492 void CloudPolicyClient::NotifyRobotAuthCodesFetched() {
482 FOR_EACH_OBSERVER(Observer, observers_, OnRobotAuthCodesFetched(this)); 493 FOR_EACH_OBSERVER(Observer, observers_, OnRobotAuthCodesFetched(this));
483 } 494 }
484 495
485 void CloudPolicyClient::NotifyClientError() { 496 void CloudPolicyClient::NotifyClientError() {
486 FOR_EACH_OBSERVER(Observer, observers_, OnClientError(this)); 497 FOR_EACH_OBSERVER(Observer, observers_, OnClientError(this));
487 } 498 }
488 499
489 } // namespace policy 500 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698