OLD | NEW |
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/login/enrollment/auto_enrollment_check_step.h" | 5 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_step.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 auto_enrollment_controller_(auto_enrollment_controller), | 22 auto_enrollment_controller_(auto_enrollment_controller), |
23 captive_portal_status_( | 23 captive_portal_status_( |
24 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN), | 24 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN), |
25 auto_enrollment_state_(policy::AUTO_ENROLLMENT_STATE_IDLE) {} | 25 auto_enrollment_state_(policy::AUTO_ENROLLMENT_STATE_IDLE) {} |
26 | 26 |
27 AutoEnrollmentCheckStep::~AutoEnrollmentCheckStep() { | 27 AutoEnrollmentCheckStep::~AutoEnrollmentCheckStep() { |
28 NetworkPortalDetector::Get()->RemoveObserver(this); | 28 NetworkPortalDetector::Get()->RemoveObserver(this); |
29 } | 29 } |
30 | 30 |
31 void AutoEnrollmentCheckStep::Start() { | 31 void AutoEnrollmentCheckStep::Start() { |
32 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 32 if (AutoEnrollmentController::GetMode() != |
33 chromeos::switches::kEnterpriseEnableForcedReEnrollment)) { | 33 AutoEnrollmentController::MODE_FORCED_RE_ENROLLMENT) { |
34 SignalCompletion(); | 34 SignalCompletion(); |
35 return; | 35 return; |
36 } | 36 } |
37 | 37 |
38 // Make sure the auto-enrollment client is running. | 38 // Make sure the auto-enrollment client is running. |
39 auto_enrollment_controller_->Start(); | 39 auto_enrollment_controller_->Start(); |
40 | 40 |
41 auto_enrollment_progress_subscription_ = | 41 auto_enrollment_progress_subscription_ = |
42 auto_enrollment_controller_->RegisterProgressCallback( | 42 auto_enrollment_controller_->RegisterProgressCallback( |
43 base::Bind(&AutoEnrollmentCheckStep::OnAutoEnrollmentCheckProgressed, | 43 base::Bind(&AutoEnrollmentCheckStep::OnAutoEnrollmentCheckProgressed, |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 167 } |
168 | 168 |
169 void AutoEnrollmentCheckStep::SignalCompletion() { | 169 void AutoEnrollmentCheckStep::SignalCompletion() { |
170 NetworkPortalDetector::Get()->RemoveObserver(this); | 170 NetworkPortalDetector::Get()->RemoveObserver(this); |
171 auto_enrollment_progress_subscription_.reset(); | 171 auto_enrollment_progress_subscription_.reset(); |
172 screen_observer_->OnExit( | 172 screen_observer_->OnExit( |
173 ScreenObserver::ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED); | 173 ScreenObserver::ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED); |
174 } | 174 } |
175 | 175 |
176 } // namespace chromeos | 176 } // namespace chromeos |
OLD | NEW |