| 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 | 241 |
| 242 void AutoEnrollmentCheckScreen::SignalCompletion() { | 242 void AutoEnrollmentCheckScreen::SignalCompletion() { |
| 243 network_portal_detector::GetInstance()->RemoveObserver(this); | 243 network_portal_detector::GetInstance()->RemoveObserver(this); |
| 244 auto_enrollment_progress_subscription_.reset(); | 244 auto_enrollment_progress_subscription_.reset(); |
| 245 connect_request_subscription_.reset(); | 245 connect_request_subscription_.reset(); |
| 246 | 246 |
| 247 // Calling Finish() can cause |this| destruction, so let other methods finish | 247 // Calling Finish() can cause |this| destruction, so let other methods finish |
| 248 // their work before. | 248 // their work before. |
| 249 base::ThreadTaskRunnerHandle::Get()->PostTask( | 249 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 250 FROM_HERE, | 250 FROM_HERE, |
| 251 base::Bind( | 251 base::Bind(&AutoEnrollmentCheckScreen::Finish, |
| 252 &AutoEnrollmentCheckScreen::Finish, weak_ptr_factory_.GetWeakPtr(), | 252 weak_ptr_factory_.GetWeakPtr(), |
| 253 BaseScreenDelegate::ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED)); | 253 ScreenExitCode::ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED)); |
| 254 } | 254 } |
| 255 | 255 |
| 256 bool AutoEnrollmentCheckScreen::IsCompleted() const { | 256 bool AutoEnrollmentCheckScreen::IsCompleted() const { |
| 257 switch (auto_enrollment_controller_->state()) { | 257 switch (auto_enrollment_controller_->state()) { |
| 258 case policy::AUTO_ENROLLMENT_STATE_IDLE: | 258 case policy::AUTO_ENROLLMENT_STATE_IDLE: |
| 259 case policy::AUTO_ENROLLMENT_STATE_PENDING: | 259 case policy::AUTO_ENROLLMENT_STATE_PENDING: |
| 260 case policy::AUTO_ENROLLMENT_STATE_CONNECTION_ERROR: | 260 case policy::AUTO_ENROLLMENT_STATE_CONNECTION_ERROR: |
| 261 return false; | 261 return false; |
| 262 case policy::AUTO_ENROLLMENT_STATE_SERVER_ERROR: | 262 case policy::AUTO_ENROLLMENT_STATE_SERVER_ERROR: |
| 263 // Server errors don't block OOBE. | 263 // Server errors don't block OOBE. |
| 264 case policy::AUTO_ENROLLMENT_STATE_TRIGGER_ENROLLMENT: | 264 case policy::AUTO_ENROLLMENT_STATE_TRIGGER_ENROLLMENT: |
| 265 case policy::AUTO_ENROLLMENT_STATE_NO_ENROLLMENT: | 265 case policy::AUTO_ENROLLMENT_STATE_NO_ENROLLMENT: |
| 266 // Decision made, ready to proceed. | 266 // Decision made, ready to proceed. |
| 267 return true; | 267 return true; |
| 268 } | 268 } |
| 269 NOTREACHED(); | 269 NOTREACHED(); |
| 270 return false; | 270 return false; |
| 271 } | 271 } |
| 272 | 272 |
| 273 void AutoEnrollmentCheckScreen::OnConnectRequested() { | 273 void AutoEnrollmentCheckScreen::OnConnectRequested() { |
| 274 auto_enrollment_controller_->Retry(); | 274 auto_enrollment_controller_->Retry(); |
| 275 } | 275 } |
| 276 | 276 |
| 277 } // namespace chromeos | 277 } // namespace chromeos |
| OLD | NEW |