| 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 "chrome/browser/chromeos/policy/auto_enrollment_client.h" | 5 #include "chrome/browser/chromeos/policy/auto_enrollment_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/guid.h" | 9 #include "base/guid.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 should_auto_enroll_(false), | 98 should_auto_enroll_(false), |
| 99 device_id_(base::GenerateGUID()), | 99 device_id_(base::GenerateGUID()), |
| 100 power_initial_(power_initial), | 100 power_initial_(power_initial), |
| 101 power_limit_(power_limit), | 101 power_limit_(power_limit), |
| 102 requests_sent_(0), | 102 requests_sent_(0), |
| 103 device_management_service_(service), | 103 device_management_service_(service), |
| 104 local_state_(local_state) { | 104 local_state_(local_state) { |
| 105 request_context_ = new SystemPolicyRequestContext( | 105 request_context_ = new SystemPolicyRequestContext( |
| 106 system_request_context, | 106 system_request_context, |
| 107 content::GetUserAgent( | 107 content::GetUserAgent( |
| 108 GURL(device_management_service_->GetServerURL()))); | 108 GURL(device_management_service_->GetServerUrl()))); |
| 109 | 109 |
| 110 DCHECK_LE(power_initial_, power_limit_); | 110 DCHECK_LE(power_initial_, power_limit_); |
| 111 DCHECK(!completion_callback_.is_null()); | 111 DCHECK(!completion_callback_.is_null()); |
| 112 if (!serial_number.empty()) | 112 if (!serial_number.empty()) |
| 113 serial_number_hash_ = crypto::SHA256HashString(serial_number); | 113 serial_number_hash_ = crypto::SHA256HashString(serial_number); |
| 114 net::NetworkChangeNotifier::AddNetworkChangeObserver(this); | 114 net::NetworkChangeNotifier::AddNetworkChangeObserver(this); |
| 115 } | 115 } |
| 116 | 116 |
| 117 AutoEnrollmentClient::~AutoEnrollmentClient() { | 117 AutoEnrollmentClient::~AutoEnrollmentClient() { |
| 118 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this); | 118 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this); |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 request_job_.reset(); | 387 request_job_.reset(); |
| 388 time_start_ = base::Time(); | 388 time_start_ = base::Time(); |
| 389 | 389 |
| 390 if (completion_callback_.is_null()) { | 390 if (completion_callback_.is_null()) { |
| 391 // CancelAndDeleteSoon() was invoked before. | 391 // CancelAndDeleteSoon() was invoked before. |
| 392 base::MessageLoopProxy::current()->DeleteSoon(FROM_HERE, this); | 392 base::MessageLoopProxy::current()->DeleteSoon(FROM_HERE, this); |
| 393 } | 393 } |
| 394 } | 394 } |
| 395 | 395 |
| 396 } // namespace policy | 396 } // namespace policy |
| OLD | NEW |