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

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

Issue 2642793002: Don't start device cloud policy connection after Chromad enrollment (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/device_cloud_policy_initializer.h" 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 !device_store_->has_policy() || 272 !device_store_->has_policy() ||
273 state_keys_broker_->pending() || 273 state_keys_broker_->pending() ||
274 enrollment_handler_) { 274 enrollment_handler_) {
275 return; 275 return;
276 } 276 }
277 StartConnection(CreateClient(enterprise_service_)); 277 StartConnection(CreateClient(enterprise_service_));
278 } 278 }
279 279
280 void DeviceCloudPolicyInitializer::StartConnection( 280 void DeviceCloudPolicyInitializer::StartConnection(
281 std::unique_ptr<CloudPolicyClient> client) { 281 std::unique_ptr<CloudPolicyClient> client) {
282 if (!manager_->core()->service()) 282 if (!manager_->core()->service() &&
283 !install_attributes_->IsActiveDirectoryManaged()) {
emaxx 2017/01/18 15:33:56 I think that it would be clearer if StartConnectio
Thiemo Nagel 2017/01/18 17:27:04 Done.
283 manager_->StartConnection(std::move(client), install_attributes_); 284 manager_->StartConnection(std::move(client), install_attributes_);
285 }
284 } 286 }
285 287
286 bool DeviceCloudPolicyInitializer::GetMachineFlag(const std::string& key, 288 bool DeviceCloudPolicyInitializer::GetMachineFlag(const std::string& key,
287 bool default_value) const { 289 bool default_value) const {
288 bool value = default_value; 290 bool value = default_value;
289 if (!statistics_provider_->GetMachineFlag(key, &value)) 291 if (!statistics_provider_->GetMachineFlag(key, &value))
290 return default_value; 292 return default_value;
291 293
292 return value; 294 return value;
293 } 295 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 if (success && (success = att_signed_data.ParseFromString(signed_data))) { 329 if (success && (success = att_signed_data.ParseFromString(signed_data))) {
328 em_signed_data.set_data(att_signed_data.data()); 330 em_signed_data.set_data(att_signed_data.data());
329 em_signed_data.set_signature(att_signed_data.signature()); 331 em_signed_data.set_signature(att_signed_data.signature());
330 em_signed_data.set_extra_data_bytes(att_signed_data.data().size() - 332 em_signed_data.set_extra_data_bytes(att_signed_data.data().size() -
331 data.size()); 333 data.size());
332 } 334 }
333 callback.Run(success, em_signed_data); 335 callback.Run(success, em_signed_data);
334 } 336 }
335 337
336 } // namespace policy 338 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698