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

Side by Side Diff: chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc

Issue 2371213002: Refactor: Inject StatisticsProvider as a dependency of DeviceCloudPolicyInitializer. (Closed)
Patch Set: Remove artefact of manual testing. Created 4 years, 2 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 "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h" 5 #include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 112
113 EnrollmentHandlerChromeOS::~EnrollmentHandlerChromeOS() { 113 EnrollmentHandlerChromeOS::~EnrollmentHandlerChromeOS() {
114 Stop(); 114 Stop();
115 store_->RemoveObserver(this); 115 store_->RemoveObserver(this);
116 } 116 }
117 117
118 void EnrollmentHandlerChromeOS::StartEnrollment() { 118 void EnrollmentHandlerChromeOS::StartEnrollment() {
119 CHECK_EQ(STEP_PENDING, enrollment_step_); 119 CHECK_EQ(STEP_PENDING, enrollment_step_);
120 enrollment_step_ = STEP_STATE_KEYS; 120 enrollment_step_ = STEP_STATE_KEYS;
121
122 if (client_->machine_id().empty()) {
123 LOG(ERROR) << "Machine id empty.";
124 ReportResult(EnrollmentStatus::ForStatus(
125 EnrollmentStatus::STATUS_NO_MACHINE_IDENTIFICATION));
126 return;
127 }
128 if (client_->machine_model().empty()) {
129 LOG(ERROR) << "Machine model empty.";
130 ReportResult(EnrollmentStatus::ForStatus(
131 EnrollmentStatus::STATUS_NO_MACHINE_IDENTIFICATION));
132 return;
133 }
Mattias Nissler (ping if slow) 2016/09/29 09:12:26 Since device policy is the only case where machine
134
121 state_keys_broker_->RequestStateKeys( 135 state_keys_broker_->RequestStateKeys(
122 base::Bind(&EnrollmentHandlerChromeOS::HandleStateKeysResult, 136 base::Bind(&EnrollmentHandlerChromeOS::HandleStateKeysResult,
123 weak_ptr_factory_.GetWeakPtr())); 137 weak_ptr_factory_.GetWeakPtr()));
124 } 138 }
125 139
126 std::unique_ptr<CloudPolicyClient> EnrollmentHandlerChromeOS::ReleaseClient() { 140 std::unique_ptr<CloudPolicyClient> EnrollmentHandlerChromeOS::ReleaseClient() {
127 Stop(); 141 Stop();
128 return std::move(client_); 142 return std::move(client_);
129 } 143 }
130 144
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 << ", validation: " << status.validation_status() 504 << ", validation: " << status.validation_status()
491 << ", store: " << status.store_status() 505 << ", store: " << status.store_status()
492 << ", lock: " << status.lock_status(); 506 << ", lock: " << status.lock_status();
493 } 507 }
494 508
495 if (!callback.is_null()) 509 if (!callback.is_null())
496 callback.Run(status); 510 callback.Run(status);
497 } 511 }
498 512
499 } // namespace policy 513 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698