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/location.h" | 10 #include "base/location.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 // static | 40 // static |
41 AutoEnrollmentCheckScreen* AutoEnrollmentCheckScreen::Get( | 41 AutoEnrollmentCheckScreen* AutoEnrollmentCheckScreen::Get( |
42 ScreenManager* manager) { | 42 ScreenManager* manager) { |
43 return static_cast<AutoEnrollmentCheckScreen*>( | 43 return static_cast<AutoEnrollmentCheckScreen*>( |
44 manager->GetScreen(WizardController::kAutoEnrollmentCheckScreenName)); | 44 manager->GetScreen(WizardController::kAutoEnrollmentCheckScreenName)); |
45 } | 45 } |
46 | 46 |
47 AutoEnrollmentCheckScreen::AutoEnrollmentCheckScreen( | 47 AutoEnrollmentCheckScreen::AutoEnrollmentCheckScreen( |
48 BaseScreenDelegate* base_screen_delegate, | 48 BaseScreenDelegate* base_screen_delegate, |
49 AutoEnrollmentCheckScreenActor* actor) | 49 AutoEnrollmentCheckScreenActor* actor) |
50 : BaseScreen(base_screen_delegate), | 50 : BaseScreen(base_screen_delegate, |
| 51 WizardController::kAutoEnrollmentCheckScreenName), |
51 actor_(actor), | 52 actor_(actor), |
52 auto_enrollment_controller_(nullptr), | 53 auto_enrollment_controller_(nullptr), |
53 captive_portal_status_( | 54 captive_portal_status_( |
54 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN), | 55 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN), |
55 auto_enrollment_state_(policy::AUTO_ENROLLMENT_STATE_IDLE), | 56 auto_enrollment_state_(policy::AUTO_ENROLLMENT_STATE_IDLE), |
56 histogram_helper_(new ErrorScreensHistogramHelper("Enrollment")), | 57 histogram_helper_(new ErrorScreensHistogramHelper("Enrollment")), |
57 weak_ptr_factory_(this) { | 58 weak_ptr_factory_(this) { |
58 if (actor_) | 59 if (actor_) |
59 actor_->SetDelegate(this); | 60 actor_->SetDelegate(this); |
60 } | 61 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 auto_enrollment_state_ = new_auto_enrollment_state; | 114 auto_enrollment_state_ = new_auto_enrollment_state; |
114 | 115 |
115 // Make sure gears are in motion in the background. | 116 // Make sure gears are in motion in the background. |
116 auto_enrollment_controller_->Start(); | 117 auto_enrollment_controller_->Start(); |
117 network_portal_detector::GetInstance()->StartDetectionIfIdle(); | 118 network_portal_detector::GetInstance()->StartDetectionIfIdle(); |
118 } | 119 } |
119 | 120 |
120 void AutoEnrollmentCheckScreen::Hide() { | 121 void AutoEnrollmentCheckScreen::Hide() { |
121 } | 122 } |
122 | 123 |
123 std::string AutoEnrollmentCheckScreen::GetName() const { | |
124 return WizardController::kAutoEnrollmentCheckScreenName; | |
125 } | |
126 | |
127 void AutoEnrollmentCheckScreen::OnActorDestroyed( | 124 void AutoEnrollmentCheckScreen::OnActorDestroyed( |
128 AutoEnrollmentCheckScreenActor* actor) { | 125 AutoEnrollmentCheckScreenActor* actor) { |
129 if (actor_ == actor) | 126 if (actor_ == actor) |
130 actor_ = NULL; | 127 actor_ = NULL; |
131 } | 128 } |
132 | 129 |
133 void AutoEnrollmentCheckScreen::OnPortalDetectionCompleted( | 130 void AutoEnrollmentCheckScreen::OnPortalDetectionCompleted( |
134 const NetworkState* /* network */, | 131 const NetworkState* /* network */, |
135 const NetworkPortalDetector::CaptivePortalState& /* state */) { | 132 const NetworkPortalDetector::CaptivePortalState& /* state */) { |
136 UpdateState(); | 133 UpdateState(); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 } | 268 } |
272 NOTREACHED(); | 269 NOTREACHED(); |
273 return false; | 270 return false; |
274 } | 271 } |
275 | 272 |
276 void AutoEnrollmentCheckScreen::OnConnectRequested() { | 273 void AutoEnrollmentCheckScreen::OnConnectRequested() { |
277 auto_enrollment_controller_->Retry(); | 274 auto_enrollment_controller_->Retry(); |
278 } | 275 } |
279 | 276 |
280 } // namespace chromeos | 277 } // namespace chromeos |
OLD | NEW |