| 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/login/wizard_controller.h" | 5 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 VLOG(1) << "Showing EULA screen."; | 454 VLOG(1) << "Showing EULA screen."; |
| 455 SetStatusAreaVisible(true); | 455 SetStatusAreaVisible(true); |
| 456 SetCurrentScreen(GetScreen(kEulaScreenName)); | 456 SetCurrentScreen(GetScreen(kEulaScreenName)); |
| 457 } | 457 } |
| 458 | 458 |
| 459 void WizardController::ShowEnrollmentScreen() { | 459 void WizardController::ShowEnrollmentScreen() { |
| 460 // Update the enrollment configuration and start the screen. | 460 // Update the enrollment configuration and start the screen. |
| 461 prescribed_enrollment_config_ = g_browser_process->platform_part() | 461 prescribed_enrollment_config_ = g_browser_process->platform_part() |
| 462 ->browser_policy_connector_chromeos() | 462 ->browser_policy_connector_chromeos() |
| 463 ->GetPrescribedEnrollmentConfig(); | 463 ->GetPrescribedEnrollmentConfig(); |
| 464 StartEnrollmentScreen(); | 464 StartEnrollmentScreen(false); |
| 465 } | 465 } |
| 466 | 466 |
| 467 void WizardController::ShowResetScreen() { | 467 void WizardController::ShowResetScreen() { |
| 468 VLOG(1) << "Showing reset screen."; | 468 VLOG(1) << "Showing reset screen."; |
| 469 SetStatusAreaVisible(false); | 469 SetStatusAreaVisible(false); |
| 470 SetCurrentScreen(GetScreen(kResetScreenName)); | 470 SetCurrentScreen(GetScreen(kResetScreenName)); |
| 471 } | 471 } |
| 472 | 472 |
| 473 void WizardController::ShowKioskEnableScreen() { | 473 void WizardController::ShowKioskEnableScreen() { |
| 474 VLOG(1) << "Showing kiosk enable screen."; | 474 VLOG(1) << "Showing kiosk enable screen."; |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 } | 784 } |
| 785 | 785 |
| 786 void WizardController::OnDeviceDisabledChecked(bool device_disabled) { | 786 void WizardController::OnDeviceDisabledChecked(bool device_disabled) { |
| 787 prescribed_enrollment_config_ = g_browser_process->platform_part() | 787 prescribed_enrollment_config_ = g_browser_process->platform_part() |
| 788 ->browser_policy_connector_chromeos() | 788 ->browser_policy_connector_chromeos() |
| 789 ->GetPrescribedEnrollmentConfig(); | 789 ->GetPrescribedEnrollmentConfig(); |
| 790 if (device_disabled) { | 790 if (device_disabled) { |
| 791 ShowDeviceDisabledScreen(); | 791 ShowDeviceDisabledScreen(); |
| 792 } else if (skip_update_enroll_after_eula_ || | 792 } else if (skip_update_enroll_after_eula_ || |
| 793 prescribed_enrollment_config_.should_enroll()) { | 793 prescribed_enrollment_config_.should_enroll()) { |
| 794 StartEnrollmentScreen(); | 794 StartEnrollmentScreen(skip_update_enroll_after_eula_); |
| 795 } else { | 795 } else { |
| 796 PerformOOBECompletedActions(); | 796 PerformOOBECompletedActions(); |
| 797 ShowLoginScreen(LoginScreenContext()); | 797 ShowLoginScreen(LoginScreenContext()); |
| 798 } | 798 } |
| 799 } | 799 } |
| 800 | 800 |
| 801 void WizardController::InitiateOOBEUpdate() { | 801 void WizardController::InitiateOOBEUpdate() { |
| 802 if (IsRemoraRequisition()) { | 802 if (IsRemoraRequisition()) { |
| 803 VLOG(1) << "Skip OOBE Update for remora."; | 803 VLOG(1) << "Skip OOBE Update for remora."; |
| 804 OnUpdateCompleted(); | 804 OnUpdateCompleted(); |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1377 remora_controller_->OnNetworkConnectivityChanged( | 1377 remora_controller_->OnNetworkConnectivityChanged( |
| 1378 pairing_chromeos::HostPairingController::CONNECTIVITY_CONNECTED); | 1378 pairing_chromeos::HostPairingController::CONNECTIVITY_CONNECTED); |
| 1379 InitiateOOBEUpdate(); | 1379 InitiateOOBEUpdate(); |
| 1380 } | 1380 } |
| 1381 | 1381 |
| 1382 void WizardController::OnSetHostNetworkFailed() { | 1382 void WizardController::OnSetHostNetworkFailed() { |
| 1383 remora_controller_->OnNetworkConnectivityChanged( | 1383 remora_controller_->OnNetworkConnectivityChanged( |
| 1384 pairing_chromeos::HostPairingController::CONNECTIVITY_NONE); | 1384 pairing_chromeos::HostPairingController::CONNECTIVITY_NONE); |
| 1385 } | 1385 } |
| 1386 | 1386 |
| 1387 void WizardController::StartEnrollmentScreen() { | 1387 void WizardController::StartEnrollmentScreen(bool force_interactive) { |
| 1388 VLOG(1) << "Showing enrollment screen."; | 1388 VLOG(1) << "Showing enrollment screen." |
| 1389 << " Forcing interactive enrollment: " << force_interactive << "."; |
| 1389 | 1390 |
| 1390 // Determine the effective enrollment configuration. If there is a valid | 1391 // Determine the effective enrollment configuration. If there is a valid |
| 1391 // prescribed configuration, use that. If not, figure out which variant of | 1392 // prescribed configuration, use that. If not, figure out which variant of |
| 1392 // manual enrollment is taking place. | 1393 // manual enrollment is taking place. |
| 1393 policy::EnrollmentConfig effective_config = prescribed_enrollment_config_; | 1394 policy::EnrollmentConfig effective_config = prescribed_enrollment_config_; |
| 1394 if (!effective_config.should_enroll()) { | 1395 if (!effective_config.should_enroll() || |
| 1396 (force_interactive && !effective_config.should_enroll_interactively())) { |
| 1395 effective_config.mode = | 1397 effective_config.mode = |
| 1396 prescribed_enrollment_config_.management_domain.empty() | 1398 prescribed_enrollment_config_.management_domain.empty() |
| 1397 ? policy::EnrollmentConfig::MODE_MANUAL | 1399 ? policy::EnrollmentConfig::MODE_MANUAL |
| 1398 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; | 1400 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; |
| 1399 } | 1401 } |
| 1400 | 1402 |
| 1401 EnrollmentScreen* screen = EnrollmentScreen::Get(this); | 1403 EnrollmentScreen* screen = EnrollmentScreen::Get(this); |
| 1402 screen->SetParameters(effective_config, shark_controller_.get()); | 1404 screen->SetParameters(effective_config, shark_controller_.get()); |
| 1403 SetStatusAreaVisible(true); | 1405 SetStatusAreaVisible(true); |
| 1404 SetCurrentScreen(screen); | 1406 SetCurrentScreen(screen); |
| 1405 } | 1407 } |
| 1406 | 1408 |
| 1407 } // namespace chromeos | 1409 } // namespace chromeos |
| OLD | NEW |