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_screen.
h" | 5 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen.
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 12 matching lines...) Expand all Loading... |
23 actor_(actor), | 23 actor_(actor), |
24 captive_portal_status_( | 24 captive_portal_status_( |
25 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN), | 25 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN), |
26 auto_enrollment_state_(policy::AUTO_ENROLLMENT_STATE_IDLE) { | 26 auto_enrollment_state_(policy::AUTO_ENROLLMENT_STATE_IDLE) { |
27 if (actor_) | 27 if (actor_) |
28 actor_->SetDelegate(this); | 28 actor_->SetDelegate(this); |
29 } | 29 } |
30 | 30 |
31 AutoEnrollmentCheckScreen::~AutoEnrollmentCheckScreen() { | 31 AutoEnrollmentCheckScreen::~AutoEnrollmentCheckScreen() { |
32 NetworkPortalDetector::Get()->RemoveObserver(this); | 32 NetworkPortalDetector::Get()->RemoveObserver(this); |
| 33 if (actor_) |
| 34 actor_->SetDelegate(NULL); |
33 } | 35 } |
34 | 36 |
35 void AutoEnrollmentCheckScreen::Start() { | 37 void AutoEnrollmentCheckScreen::Start() { |
36 if (!IsStartNeeded()) | 38 if (!IsStartNeeded()) |
37 return; | 39 return; |
38 | 40 |
39 // Make sure the auto-enrollment client is running. | 41 // Make sure the auto-enrollment client is running. |
40 auto_enrollment_controller_->Start(); | 42 auto_enrollment_controller_->Start(); |
41 | 43 |
42 auto_enrollment_progress_subscription_ = | 44 auto_enrollment_progress_subscription_ = |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 214 } |
213 | 215 |
214 void AutoEnrollmentCheckScreen::SignalCompletion() { | 216 void AutoEnrollmentCheckScreen::SignalCompletion() { |
215 NetworkPortalDetector::Get()->RemoveObserver(this); | 217 NetworkPortalDetector::Get()->RemoveObserver(this); |
216 auto_enrollment_progress_subscription_.reset(); | 218 auto_enrollment_progress_subscription_.reset(); |
217 get_screen_observer()->OnExit( | 219 get_screen_observer()->OnExit( |
218 ScreenObserver::ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED); | 220 ScreenObserver::ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED); |
219 } | 221 } |
220 | 222 |
221 } // namespace chromeos | 223 } // namespace chromeos |
OLD | NEW |