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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 } else if (screen == OobeScreen::SCREEN_ENCRYPTION_MIGRATION) { | 422 } else if (screen == OobeScreen::SCREEN_ENCRYPTION_MIGRATION) { |
423 return new EncryptionMigrationScreen( | 423 return new EncryptionMigrationScreen( |
424 this, oobe_ui_->GetEncryptionMigrationScreenView()); | 424 this, oobe_ui_->GetEncryptionMigrationScreenView()); |
425 } | 425 } |
426 | 426 |
427 return nullptr; | 427 return nullptr; |
428 } | 428 } |
429 | 429 |
430 void WizardController::ShowNetworkScreen() { | 430 void WizardController::ShowNetworkScreen() { |
431 VLOG(1) << "Showing network screen."; | 431 VLOG(1) << "Showing network screen."; |
432 // Hide the status area initially; it only appears after OOBE first animates | 432 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_OOBE_NETWORK); |
433 // in. Keep it visible if the user goes back to the existing network screen. | |
434 SetStatusAreaVisible( | |
435 screen_manager_->HasScreen(OobeScreen::SCREEN_OOBE_NETWORK)); | |
436 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_NETWORK)); | 433 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_NETWORK)); |
437 | 434 |
438 // There are two possible screens where we listen to the incoming Bluetooth | 435 // There are two possible screens where we listen to the incoming Bluetooth |
439 // connection request: the first one is the HID detection screen, which will | 436 // connection request: the first one is the HID detection screen, which will |
440 // show up when there is no sufficient input devices. In this case, we just | 437 // show up when there is no sufficient input devices. In this case, we just |
441 // keep the logic as it is today: always put the Bluetooth is discoverable | 438 // keep the logic as it is today: always put the Bluetooth is discoverable |
442 // mode. The other place is the Network screen (here), which will show up when | 439 // mode. The other place is the Network screen (here), which will show up when |
443 // there are input devices detected. In this case, we disable the Bluetooth by | 440 // there are input devices detected. In this case, we disable the Bluetooth by |
444 // default until the user explicitly enable it by pressing a key combo (Ctrl+ | 441 // default until the user explicitly enable it by pressing a key combo (Ctrl+ |
445 // Alt+Shift+S). | 442 // Alt+Shift+S). |
446 if (IsBootstrappingSlave()) | 443 if (IsBootstrappingSlave()) |
447 MaybeStartListeningForSharkConnection(); | 444 MaybeStartListeningForSharkConnection(); |
448 } | 445 } |
449 | 446 |
450 void WizardController::ShowLoginScreen(const LoginScreenContext& context) { | 447 void WizardController::ShowLoginScreen(const LoginScreenContext& context) { |
451 // This may be triggered by multiply asynchronous events from the JS side. | 448 // This may be triggered by multiply asynchronous events from the JS side. |
452 if (login_screen_started_) | 449 if (login_screen_started_) |
453 return; | 450 return; |
454 | 451 |
455 if (!time_eula_accepted_.is_null()) { | 452 if (!time_eula_accepted_.is_null()) { |
456 base::TimeDelta delta = base::Time::Now() - time_eula_accepted_; | 453 base::TimeDelta delta = base::Time::Now() - time_eula_accepted_; |
457 UMA_HISTOGRAM_MEDIUM_TIMES("OOBE.EULAToSignInTime", delta); | 454 UMA_HISTOGRAM_MEDIUM_TIMES("OOBE.EULAToSignInTime", delta); |
458 } | 455 } |
459 VLOG(1) << "Showing login screen."; | 456 VLOG(1) << "Showing login screen."; |
460 SetStatusAreaVisible(true); | 457 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_SPECIAL_LOGIN); |
461 host_->StartSignInScreen(context); | 458 host_->StartSignInScreen(context); |
462 smooth_show_timer_.Stop(); | 459 smooth_show_timer_.Stop(); |
463 login_screen_started_ = true; | 460 login_screen_started_ = true; |
464 } | 461 } |
465 | 462 |
466 void WizardController::ShowUpdateScreen() { | 463 void WizardController::ShowUpdateScreen() { |
467 VLOG(1) << "Showing update screen."; | 464 VLOG(1) << "Showing update screen."; |
468 SetStatusAreaVisible(true); | 465 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_OOBE_UPDATE); |
469 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_UPDATE)); | 466 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_UPDATE)); |
470 } | 467 } |
471 | 468 |
472 void WizardController::ShowUserImageScreen() { | 469 void WizardController::ShowUserImageScreen() { |
473 const user_manager::UserManager* user_manager = | 470 const user_manager::UserManager* user_manager = |
474 user_manager::UserManager::Get(); | 471 user_manager::UserManager::Get(); |
475 // Skip user image selection for public sessions and ephemeral non-regual user | 472 // Skip user image selection for public sessions and ephemeral non-regual user |
476 // logins. | 473 // logins. |
477 if (user_manager->IsLoggedInAsPublicAccount() || | 474 if (user_manager->IsLoggedInAsPublicAccount() || |
478 (user_manager->IsCurrentUserNonCryptohomeDataEphemeral() && | 475 (user_manager->IsCurrentUserNonCryptohomeDataEphemeral() && |
479 user_manager->GetActiveUser()->GetType() != | 476 user_manager->GetActiveUser()->GetType() != |
480 user_manager::USER_TYPE_REGULAR)) { | 477 user_manager::USER_TYPE_REGULAR)) { |
481 OnUserImageSkipped(); | 478 OnUserImageSkipped(); |
482 return; | 479 return; |
483 } | 480 } |
484 VLOG(1) << "Showing user image screen."; | 481 VLOG(1) << "Showing user image screen."; |
485 | 482 |
486 // Status area has been already shown at sign in screen so it | 483 // Status area has been already shown at sign in screen so it |
487 // doesn't make sense to hide it here and then show again at user session as | 484 // doesn't make sense to hide it here and then show again at user session as |
488 // this produces undesired UX transitions. | 485 // this produces undesired UX transitions. |
489 SetStatusAreaVisible(true); | 486 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_USER_IMAGE_PICKER); |
490 | 487 |
491 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_USER_IMAGE_PICKER)); | 488 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_USER_IMAGE_PICKER)); |
492 } | 489 } |
493 | 490 |
494 void WizardController::ShowEulaScreen() { | 491 void WizardController::ShowEulaScreen() { |
495 VLOG(1) << "Showing EULA screen."; | 492 VLOG(1) << "Showing EULA screen."; |
496 SetStatusAreaVisible(true); | 493 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_OOBE_EULA); |
497 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_EULA)); | 494 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_EULA)); |
498 } | 495 } |
499 | 496 |
500 void WizardController::ShowEnrollmentScreen() { | 497 void WizardController::ShowEnrollmentScreen() { |
501 // Update the enrollment configuration and start the screen. | 498 // Update the enrollment configuration and start the screen. |
502 prescribed_enrollment_config_ = g_browser_process->platform_part() | 499 prescribed_enrollment_config_ = g_browser_process->platform_part() |
503 ->browser_policy_connector_chromeos() | 500 ->browser_policy_connector_chromeos() |
504 ->GetPrescribedEnrollmentConfig(); | 501 ->GetPrescribedEnrollmentConfig(); |
505 StartEnrollmentScreen(false); | 502 StartEnrollmentScreen(false); |
506 } | 503 } |
507 | 504 |
508 void WizardController::ShowResetScreen() { | 505 void WizardController::ShowResetScreen() { |
509 VLOG(1) << "Showing reset screen."; | 506 VLOG(1) << "Showing reset screen."; |
510 SetStatusAreaVisible(false); | 507 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_OOBE_RESET); |
511 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_RESET)); | 508 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_RESET)); |
512 } | 509 } |
513 | 510 |
514 void WizardController::ShowKioskEnableScreen() { | 511 void WizardController::ShowKioskEnableScreen() { |
515 VLOG(1) << "Showing kiosk enable screen."; | 512 VLOG(1) << "Showing kiosk enable screen."; |
516 SetStatusAreaVisible(false); | 513 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_KIOSK_ENABLE); |
517 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_KIOSK_ENABLE)); | 514 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_KIOSK_ENABLE)); |
518 } | 515 } |
519 | 516 |
520 void WizardController::ShowKioskAutolaunchScreen() { | 517 void WizardController::ShowKioskAutolaunchScreen() { |
521 VLOG(1) << "Showing kiosk autolaunch screen."; | 518 VLOG(1) << "Showing kiosk autolaunch screen."; |
522 SetStatusAreaVisible(false); | 519 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_KIOSK_AUTOLAUNCH); |
523 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_KIOSK_AUTOLAUNCH)); | 520 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_KIOSK_AUTOLAUNCH)); |
524 } | 521 } |
525 | 522 |
526 void WizardController::ShowEnableDebuggingScreen() { | 523 void WizardController::ShowEnableDebuggingScreen() { |
527 VLOG(1) << "Showing enable developer features screen."; | 524 VLOG(1) << "Showing enable developer features screen."; |
528 SetStatusAreaVisible(false); | 525 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_OOBE_ENABLE_DEBUGGING); |
529 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_ENABLE_DEBUGGING)); | 526 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_ENABLE_DEBUGGING)); |
530 } | 527 } |
531 | 528 |
532 void WizardController::ShowTermsOfServiceScreen() { | 529 void WizardController::ShowTermsOfServiceScreen() { |
533 // Only show the Terms of Service when logging into a public account and Terms | 530 // Only show the Terms of Service when logging into a public account and Terms |
534 // of Service have been specified through policy. In all other cases, advance | 531 // of Service have been specified through policy. In all other cases, advance |
535 // to the ARC opt-in screen immediately. | 532 // to the ARC opt-in screen immediately. |
536 if (!user_manager::UserManager::Get()->IsLoggedInAsPublicAccount() || | 533 if (!user_manager::UserManager::Get()->IsLoggedInAsPublicAccount() || |
537 !ProfileManager::GetActiveUserProfile()->GetPrefs()->IsManagedPreference( | 534 !ProfileManager::GetActiveUserProfile()->GetPrefs()->IsManagedPreference( |
538 prefs::kTermsOfServiceURL)) { | 535 prefs::kTermsOfServiceURL)) { |
539 ShowArcTermsOfServiceScreen(); | 536 ShowArcTermsOfServiceScreen(); |
540 return; | 537 return; |
541 } | 538 } |
542 | 539 |
543 VLOG(1) << "Showing Terms of Service screen."; | 540 VLOG(1) << "Showing Terms of Service screen."; |
544 SetStatusAreaVisible(true); | 541 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_TERMS_OF_SERVICE); |
545 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_TERMS_OF_SERVICE)); | 542 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_TERMS_OF_SERVICE)); |
546 } | 543 } |
547 | 544 |
548 void WizardController::ShowArcTermsOfServiceScreen() { | 545 void WizardController::ShowArcTermsOfServiceScreen() { |
549 bool show_arc_terms = false; | 546 bool show_arc_terms = false; |
550 const Profile* profile = ProfileManager::GetActiveUserProfile(); | 547 const Profile* profile = ProfileManager::GetActiveUserProfile(); |
551 | 548 |
552 const base::CommandLine* command_line = | 549 const base::CommandLine* command_line = |
553 base::CommandLine::ForCurrentProcess(); | 550 base::CommandLine::ForCurrentProcess(); |
554 if (!command_line->HasSwitch(chromeos::switches::kEnableArcOOBEOptIn)) { | 551 if (!command_line->HasSwitch(chromeos::switches::kEnableArcOOBEOptIn)) { |
555 VLOG(1) << "Skip ARC Terms of Service screen because ARC OOBE OptIn is " | 552 VLOG(1) << "Skip ARC Terms of Service screen because ARC OOBE OptIn is " |
556 << "disabled."; | 553 << "disabled."; |
557 } else if (!user_manager::UserManager::Get()->IsUserLoggedIn()) { | 554 } else if (!user_manager::UserManager::Get()->IsUserLoggedIn()) { |
558 VLOG(1) << "Skip ARC Terms of Service screen because user is not " | 555 VLOG(1) << "Skip ARC Terms of Service screen because user is not " |
559 << "logged in."; | 556 << "logged in."; |
560 } else if (!arc::IsArcAllowedForProfile(profile)) { | 557 } else if (!arc::IsArcAllowedForProfile(profile)) { |
561 VLOG(1) << "Skip ARC Terms of Service screen because ARC is not allowed."; | 558 VLOG(1) << "Skip ARC Terms of Service screen because ARC is not allowed."; |
562 } else if (profile->GetPrefs()->IsManagedPreference(prefs::kArcEnabled) && | 559 } else if (profile->GetPrefs()->IsManagedPreference(prefs::kArcEnabled) && |
563 !profile->GetPrefs()->GetBoolean(prefs::kArcEnabled)) { | 560 !profile->GetPrefs()->GetBoolean(prefs::kArcEnabled)) { |
564 VLOG(1) << "Skip ARC Terms of Service screen because ARC is disabled."; | 561 VLOG(1) << "Skip ARC Terms of Service screen because ARC is disabled."; |
565 } else { | 562 } else { |
566 show_arc_terms = true; | 563 show_arc_terms = true; |
567 } | 564 } |
568 | 565 |
569 if (show_arc_terms) { | 566 if (show_arc_terms) { |
570 VLOG(1) << "Showing ARC Terms of Service screen."; | 567 VLOG(1) << "Showing ARC Terms of Service screen."; |
571 SetStatusAreaVisible(true); | 568 UpdateStatusAreaVisibilityForScreen( |
| 569 OobeScreen::SCREEN_ARC_TERMS_OF_SERVICE); |
572 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_ARC_TERMS_OF_SERVICE)); | 570 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_ARC_TERMS_OF_SERVICE)); |
573 } else { | 571 } else { |
574 ShowUserImageScreen(); | 572 ShowUserImageScreen(); |
575 } | 573 } |
576 } | 574 } |
577 | 575 |
578 void WizardController::ShowWrongHWIDScreen() { | 576 void WizardController::ShowWrongHWIDScreen() { |
579 VLOG(1) << "Showing wrong HWID screen."; | 577 VLOG(1) << "Showing wrong HWID screen."; |
580 SetStatusAreaVisible(false); | 578 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_WRONG_HWID); |
581 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_WRONG_HWID)); | 579 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_WRONG_HWID)); |
582 } | 580 } |
583 | 581 |
584 void WizardController::ShowAutoEnrollmentCheckScreen() { | 582 void WizardController::ShowAutoEnrollmentCheckScreen() { |
585 VLOG(1) << "Showing Auto-enrollment check screen."; | 583 VLOG(1) << "Showing Auto-enrollment check screen."; |
586 SetStatusAreaVisible(true); | 584 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_AUTO_ENROLLMENT_CHECK); |
587 AutoEnrollmentCheckScreen* screen = | 585 AutoEnrollmentCheckScreen* screen = |
588 AutoEnrollmentCheckScreen::Get(screen_manager()); | 586 AutoEnrollmentCheckScreen::Get(screen_manager()); |
589 if (retry_auto_enrollment_check_) | 587 if (retry_auto_enrollment_check_) |
590 screen->ClearState(); | 588 screen->ClearState(); |
591 screen->set_auto_enrollment_controller(host_->GetAutoEnrollmentController()); | 589 screen->set_auto_enrollment_controller(host_->GetAutoEnrollmentController()); |
592 SetCurrentScreen(screen); | 590 SetCurrentScreen(screen); |
593 } | 591 } |
594 | 592 |
595 void WizardController::ShowSupervisedUserCreationScreen() { | 593 void WizardController::ShowSupervisedUserCreationScreen() { |
596 VLOG(1) << "Showing Locally managed user creation screen screen."; | 594 VLOG(1) << "Showing Locally managed user creation screen screen."; |
597 SetStatusAreaVisible(true); | 595 UpdateStatusAreaVisibilityForScreen( |
| 596 OobeScreen::SCREEN_CREATE_SUPERVISED_USER_FLOW); |
598 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_CREATE_SUPERVISED_USER_FLOW)); | 597 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_CREATE_SUPERVISED_USER_FLOW)); |
599 } | 598 } |
600 | 599 |
601 void WizardController::ShowArcKioskSplashScreen() { | 600 void WizardController::ShowArcKioskSplashScreen() { |
602 VLOG(1) << "Showing ARC kiosk splash screen."; | 601 VLOG(1) << "Showing ARC kiosk splash screen."; |
603 SetStatusAreaVisible(false); | 602 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_ARC_KIOSK_SPLASH); |
604 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_ARC_KIOSK_SPLASH)); | 603 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_ARC_KIOSK_SPLASH)); |
605 } | 604 } |
606 | 605 |
607 void WizardController::ShowHIDDetectionScreen() { | 606 void WizardController::ShowHIDDetectionScreen() { |
608 VLOG(1) << "Showing HID discovery screen."; | 607 VLOG(1) << "Showing HID discovery screen."; |
609 SetStatusAreaVisible(true); | 608 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_OOBE_HID_DETECTION); |
610 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_HID_DETECTION)); | 609 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_HID_DETECTION)); |
611 // In HID detection screen, puts the Bluetooth in discoverable mode and waits | 610 // In HID detection screen, puts the Bluetooth in discoverable mode and waits |
612 // for the incoming Bluetooth connection request. See the comments in | 611 // for the incoming Bluetooth connection request. See the comments in |
613 // WizardController::ShowNetworkScreen() for more details. | 612 // WizardController::ShowNetworkScreen() for more details. |
614 MaybeStartListeningForSharkConnection(); | 613 MaybeStartListeningForSharkConnection(); |
615 } | 614 } |
616 | 615 |
617 void WizardController::ShowControllerPairingScreen() { | 616 void WizardController::ShowControllerPairingScreen() { |
618 VLOG(1) << "Showing controller pairing screen."; | 617 VLOG(1) << "Showing controller pairing screen."; |
619 SetStatusAreaVisible(false); | 618 UpdateStatusAreaVisibilityForScreen( |
| 619 OobeScreen::SCREEN_OOBE_CONTROLLER_PAIRING); |
620 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_CONTROLLER_PAIRING)); | 620 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_CONTROLLER_PAIRING)); |
621 } | 621 } |
622 | 622 |
623 void WizardController::ShowHostPairingScreen() { | 623 void WizardController::ShowHostPairingScreen() { |
624 VLOG(1) << "Showing host pairing screen."; | 624 VLOG(1) << "Showing host pairing screen."; |
625 SetStatusAreaVisible(false); | 625 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_OOBE_HOST_PAIRING); |
626 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_HOST_PAIRING)); | 626 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_HOST_PAIRING)); |
627 } | 627 } |
628 | 628 |
629 void WizardController::ShowDeviceDisabledScreen() { | 629 void WizardController::ShowDeviceDisabledScreen() { |
630 VLOG(1) << "Showing device disabled screen."; | 630 VLOG(1) << "Showing device disabled screen."; |
631 SetStatusAreaVisible(true); | 631 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_DEVICE_DISABLED); |
632 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_DEVICE_DISABLED)); | 632 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_DEVICE_DISABLED)); |
633 } | 633 } |
634 | 634 |
635 void WizardController::ShowEncryptionMigrationScreen() { | 635 void WizardController::ShowEncryptionMigrationScreen() { |
636 VLOG(1) << "Showing encryption migration screen."; | 636 VLOG(1) << "Showing encryption migration screen."; |
637 SetStatusAreaVisible(true); | 637 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_ENCRYPTION_MIGRATION); |
638 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_ENCRYPTION_MIGRATION)); | 638 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_ENCRYPTION_MIGRATION)); |
639 } | 639 } |
640 | 640 |
641 void WizardController::SkipToLoginForTesting( | 641 void WizardController::SkipToLoginForTesting( |
642 const LoginScreenContext& context) { | 642 const LoginScreenContext& context) { |
643 VLOG(1) << "SkipToLoginForTesting."; | 643 VLOG(1) << "SkipToLoginForTesting."; |
644 StartupUtils::MarkEulaAccepted(); | 644 StartupUtils::MarkEulaAccepted(); |
645 PerformPostEulaActions(); | 645 PerformPostEulaActions(); |
646 OnDeviceDisabledChecked(false /* device_disabled */); | 646 OnDeviceDisabledChecked(false /* device_disabled */); |
647 } | 647 } |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 return; | 964 return; |
965 | 965 |
966 // First remember how far have we reached so that we can resume if needed. | 966 // First remember how far have we reached so that we can resume if needed. |
967 if (is_out_of_box_ && IsResumableScreen(current_screen_->screen_id())) { | 967 if (is_out_of_box_ && IsResumableScreen(current_screen_->screen_id())) { |
968 StartupUtils::SaveOobePendingScreen( | 968 StartupUtils::SaveOobePendingScreen( |
969 GetOobeScreenName(current_screen_->screen_id())); | 969 GetOobeScreenName(current_screen_->screen_id())); |
970 } | 970 } |
971 | 971 |
972 smooth_show_timer_.Stop(); | 972 smooth_show_timer_.Stop(); |
973 | 973 |
| 974 UpdateStatusAreaVisibilityForScreen(current_screen_->screen_id()); |
974 current_screen_->Show(); | 975 current_screen_->Show(); |
975 } | 976 } |
976 | 977 |
977 void WizardController::SetCurrentScreenSmooth(BaseScreen* new_current, | 978 void WizardController::SetCurrentScreenSmooth(BaseScreen* new_current, |
978 bool use_smoothing) { | 979 bool use_smoothing) { |
979 if (current_screen_ == new_current || new_current == nullptr || | 980 if (current_screen_ == new_current || new_current == nullptr || |
980 oobe_ui_ == nullptr) { | 981 oobe_ui_ == nullptr) { |
981 return; | 982 return; |
982 } | 983 } |
983 | 984 |
(...skipping 15 matching lines...) Expand all Loading... |
999 smooth_show_timer_.Start( | 1000 smooth_show_timer_.Start( |
1000 FROM_HERE, | 1001 FROM_HERE, |
1001 base::TimeDelta::FromMilliseconds(kShowDelayMs), | 1002 base::TimeDelta::FromMilliseconds(kShowDelayMs), |
1002 this, | 1003 this, |
1003 &WizardController::ShowCurrentScreen); | 1004 &WizardController::ShowCurrentScreen); |
1004 } else { | 1005 } else { |
1005 ShowCurrentScreen(); | 1006 ShowCurrentScreen(); |
1006 } | 1007 } |
1007 } | 1008 } |
1008 | 1009 |
1009 void WizardController::SetStatusAreaVisible(bool visible) { | 1010 void WizardController::UpdateStatusAreaVisibilityForScreen(OobeScreen screen) { |
1010 host_->SetStatusAreaVisible(visible); | 1011 if (screen == OobeScreen::SCREEN_OOBE_NETWORK) { |
| 1012 // Hide the status area initially; it only appears after OOBE first animates |
| 1013 // in. Keep it visible if the user goes back to the existing network screen. |
| 1014 host_->SetStatusAreaVisible( |
| 1015 screen_manager_->HasScreen(OobeScreen::SCREEN_OOBE_NETWORK)); |
| 1016 } else if (screen == OobeScreen::SCREEN_OOBE_RESET || |
| 1017 screen == OobeScreen::SCREEN_KIOSK_ENABLE || |
| 1018 screen == OobeScreen::SCREEN_KIOSK_AUTOLAUNCH || |
| 1019 screen == OobeScreen::SCREEN_OOBE_ENABLE_DEBUGGING || |
| 1020 screen == OobeScreen::SCREEN_WRONG_HWID || |
| 1021 screen == OobeScreen::SCREEN_ARC_KIOSK_SPLASH || |
| 1022 screen == OobeScreen::SCREEN_OOBE_CONTROLLER_PAIRING || |
| 1023 screen == OobeScreen::SCREEN_OOBE_HOST_PAIRING) { |
| 1024 host_->SetStatusAreaVisible(false); |
| 1025 } else { |
| 1026 host_->SetStatusAreaVisible(true); |
| 1027 } |
1011 } | 1028 } |
1012 | 1029 |
1013 void WizardController::SetShowMdOobe(bool show) { | 1030 void WizardController::SetShowMdOobe(bool show) { |
1014 GetLocalState()->SetBoolean(prefs::kOobeMdMode, show); | 1031 GetLocalState()->SetBoolean(prefs::kOobeMdMode, show); |
1015 } | 1032 } |
1016 | 1033 |
1017 void WizardController::OnHIDScreenNecessityCheck(bool screen_needed) { | 1034 void WizardController::OnHIDScreenNecessityCheck(bool screen_needed) { |
1018 if (!oobe_ui_) | 1035 if (!oobe_ui_) |
1019 return; | 1036 return; |
1020 | 1037 |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1303 CrosSettings::Get()->PrepareTrustedValues(base::Bind( | 1320 CrosSettings::Get()->PrepareTrustedValues(base::Bind( |
1304 &WizardController::AutoLaunchKioskApp, | 1321 &WizardController::AutoLaunchKioskApp, |
1305 weak_factory_.GetWeakPtr())); | 1322 weak_factory_.GetWeakPtr())); |
1306 if (status == CrosSettingsProvider::TEMPORARILY_UNTRUSTED) | 1323 if (status == CrosSettingsProvider::TEMPORARILY_UNTRUSTED) |
1307 return; | 1324 return; |
1308 | 1325 |
1309 if (status == CrosSettingsProvider::PERMANENTLY_UNTRUSTED) { | 1326 if (status == CrosSettingsProvider::PERMANENTLY_UNTRUSTED) { |
1310 // If the |cros_settings_| are permanently untrusted, show an error message | 1327 // If the |cros_settings_| are permanently untrusted, show an error message |
1311 // and refuse to auto-launch the kiosk app. | 1328 // and refuse to auto-launch the kiosk app. |
1312 GetErrorScreen()->SetUIState(NetworkError::UI_STATE_LOCAL_STATE_ERROR); | 1329 GetErrorScreen()->SetUIState(NetworkError::UI_STATE_LOCAL_STATE_ERROR); |
1313 SetStatusAreaVisible(false); | 1330 host_->SetStatusAreaVisible(false); |
1314 ShowErrorScreen(); | 1331 ShowErrorScreen(); |
1315 return; | 1332 return; |
1316 } | 1333 } |
1317 | 1334 |
1318 bool device_disabled = false; | 1335 bool device_disabled = false; |
1319 CrosSettings::Get()->GetBoolean(kDeviceDisabled, &device_disabled); | 1336 CrosSettings::Get()->GetBoolean(kDeviceDisabled, &device_disabled); |
1320 if (device_disabled && system::DeviceDisablingManager:: | 1337 if (device_disabled && system::DeviceDisablingManager:: |
1321 HonorDeviceDisablingDuringNormalOperation()) { | 1338 HonorDeviceDisablingDuringNormalOperation()) { |
1322 // If the device is disabled, bail out. A device disabled screen will be | 1339 // If the device is disabled, bail out. A device disabled screen will be |
1323 // shown by the DeviceDisablingManager. | 1340 // shown by the DeviceDisablingManager. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 void WizardController::SkipPostLoginScreensForTesting() { | 1372 void WizardController::SkipPostLoginScreensForTesting() { |
1356 skip_post_login_screens_ = true; | 1373 skip_post_login_screens_ = true; |
1357 } | 1374 } |
1358 | 1375 |
1359 void WizardController::OnLocalStateInitialized(bool /* succeeded */) { | 1376 void WizardController::OnLocalStateInitialized(bool /* succeeded */) { |
1360 if (GetLocalState()->GetInitializationStatus() != | 1377 if (GetLocalState()->GetInitializationStatus() != |
1361 PrefService::INITIALIZATION_STATUS_ERROR) { | 1378 PrefService::INITIALIZATION_STATUS_ERROR) { |
1362 return; | 1379 return; |
1363 } | 1380 } |
1364 GetErrorScreen()->SetUIState(NetworkError::UI_STATE_LOCAL_STATE_ERROR); | 1381 GetErrorScreen()->SetUIState(NetworkError::UI_STATE_LOCAL_STATE_ERROR); |
1365 SetStatusAreaVisible(false); | 1382 host_->SetStatusAreaVisible(false); |
1366 ShowErrorScreen(); | 1383 ShowErrorScreen(); |
1367 } | 1384 } |
1368 | 1385 |
1369 PrefService* WizardController::GetLocalState() { | 1386 PrefService* WizardController::GetLocalState() { |
1370 if (local_state_for_testing_) | 1387 if (local_state_for_testing_) |
1371 return local_state_for_testing_; | 1388 return local_state_for_testing_; |
1372 return g_browser_process->local_state(); | 1389 return g_browser_process->local_state(); |
1373 } | 1390 } |
1374 | 1391 |
1375 void WizardController::OnTimezoneResolved( | 1392 void WizardController::OnTimezoneResolved( |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1511 if (!effective_config.should_enroll() || | 1528 if (!effective_config.should_enroll() || |
1512 (force_interactive && !effective_config.should_enroll_interactively())) { | 1529 (force_interactive && !effective_config.should_enroll_interactively())) { |
1513 effective_config.mode = | 1530 effective_config.mode = |
1514 prescribed_enrollment_config_.management_domain.empty() | 1531 prescribed_enrollment_config_.management_domain.empty() |
1515 ? policy::EnrollmentConfig::MODE_MANUAL | 1532 ? policy::EnrollmentConfig::MODE_MANUAL |
1516 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; | 1533 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; |
1517 } | 1534 } |
1518 | 1535 |
1519 EnrollmentScreen* screen = EnrollmentScreen::Get(screen_manager()); | 1536 EnrollmentScreen* screen = EnrollmentScreen::Get(screen_manager()); |
1520 screen->SetParameters(effective_config, shark_controller_.get()); | 1537 screen->SetParameters(effective_config, shark_controller_.get()); |
1521 SetStatusAreaVisible(true); | 1538 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_OOBE_ENROLLMENT); |
1522 SetCurrentScreen(screen); | 1539 SetCurrentScreen(screen); |
1523 } | 1540 } |
1524 | 1541 |
1525 } // namespace chromeos | 1542 } // namespace chromeos |
OLD | NEW |