Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: chrome/browser/chromeos/login/wizard_controller.cc

Issue 2912593002: Create OOBE screen for Voice Interaction value proposition (Closed)
Patch Set: Create OOBE screen for Voice Interaction value proposition Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 12 matching lines...) Expand all
23 #include "base/strings/utf_string_conversions.h" 23 #include "base/strings/utf_string_conversions.h"
24 #include "base/task_scheduler/post_task.h" 24 #include "base/task_scheduler/post_task.h"
25 #include "base/threading/sequenced_worker_pool.h" 25 #include "base/threading/sequenced_worker_pool.h"
26 #include "base/threading/thread_task_runner_handle.h" 26 #include "base/threading/thread_task_runner_handle.h"
27 #include "chrome/browser/browser_process.h" 27 #include "chrome/browser/browser_process.h"
28 #include "chrome/browser/browser_process_platform_part.h" 28 #include "chrome/browser/browser_process_platform_part.h"
29 #include "chrome/browser/chrome_notification_types.h" 29 #include "chrome/browser/chrome_notification_types.h"
30 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 30 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
31 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" 31 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
32 #include "chrome/browser/chromeos/arc/arc_util.h" 32 #include "chrome/browser/chromeos/arc/arc_util.h"
33 #include "chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_fr amework_service.h"
33 #include "chrome/browser/chromeos/customization/customization_document.h" 34 #include "chrome/browser/chromeos/customization/customization_document.h"
34 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen. h" 35 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen. h"
35 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" 36 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h"
36 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" 37 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h"
37 #include "chrome/browser/chromeos/login/existing_user_controller.h" 38 #include "chrome/browser/chromeos/login/existing_user_controller.h"
38 #include "chrome/browser/chromeos/login/helper.h" 39 #include "chrome/browser/chromeos/login/helper.h"
39 #include "chrome/browser/chromeos/login/hwid_checker.h" 40 #include "chrome/browser/chromeos/login/hwid_checker.h"
40 #include "chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.h" 41 #include "chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.h"
41 #include "chrome/browser/chromeos/login/screens/device_disabled_screen.h" 42 #include "chrome/browser/chromeos/login/screens/device_disabled_screen.h"
42 #include "chrome/browser/chromeos/login/screens/enable_debugging_screen.h" 43 #include "chrome/browser/chromeos/login/screens/enable_debugging_screen.h"
43 #include "chrome/browser/chromeos/login/screens/encryption_migration_screen.h" 44 #include "chrome/browser/chromeos/login/screens/encryption_migration_screen.h"
44 #include "chrome/browser/chromeos/login/screens/error_screen.h" 45 #include "chrome/browser/chromeos/login/screens/error_screen.h"
45 #include "chrome/browser/chromeos/login/screens/eula_screen.h" 46 #include "chrome/browser/chromeos/login/screens/eula_screen.h"
46 #include "chrome/browser/chromeos/login/screens/hid_detection_view.h" 47 #include "chrome/browser/chromeos/login/screens/hid_detection_view.h"
47 #include "chrome/browser/chromeos/login/screens/kiosk_autolaunch_screen.h" 48 #include "chrome/browser/chromeos/login/screens/kiosk_autolaunch_screen.h"
48 #include "chrome/browser/chromeos/login/screens/kiosk_enable_screen.h" 49 #include "chrome/browser/chromeos/login/screens/kiosk_enable_screen.h"
49 #include "chrome/browser/chromeos/login/screens/network_error.h" 50 #include "chrome/browser/chromeos/login/screens/network_error.h"
50 #include "chrome/browser/chromeos/login/screens/network_view.h" 51 #include "chrome/browser/chromeos/login/screens/network_view.h"
51 #include "chrome/browser/chromeos/login/screens/reset_screen.h" 52 #include "chrome/browser/chromeos/login/screens/reset_screen.h"
52 #include "chrome/browser/chromeos/login/screens/terms_of_service_screen.h" 53 #include "chrome/browser/chromeos/login/screens/terms_of_service_screen.h"
53 #include "chrome/browser/chromeos/login/screens/update_screen.h" 54 #include "chrome/browser/chromeos/login/screens/update_screen.h"
54 #include "chrome/browser/chromeos/login/screens/user_image_screen.h" 55 #include "chrome/browser/chromeos/login/screens/user_image_screen.h"
56 #include "chrome/browser/chromeos/login/screens/voice_interaction_value_prop_scr een.h"
55 #include "chrome/browser/chromeos/login/screens/wrong_hwid_screen.h" 57 #include "chrome/browser/chromeos/login/screens/wrong_hwid_screen.h"
56 #include "chrome/browser/chromeos/login/session/user_session_manager.h" 58 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
57 #include "chrome/browser/chromeos/login/startup_utils.h" 59 #include "chrome/browser/chromeos/login/startup_utils.h"
58 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_scre en.h" 60 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_scre en.h"
59 #include "chrome/browser/chromeos/login/ui/login_display_host.h" 61 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
60 #include "chrome/browser/chromeos/net/delay_network_call.h" 62 #include "chrome/browser/chromeos/net/delay_network_call.h"
61 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 63 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
62 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" 64 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
63 #include "chrome/browser/chromeos/settings/cros_settings.h" 65 #include "chrome/browser/chromeos/settings/cros_settings.h"
64 #include "chrome/browser/chromeos/system/device_disabling_manager.h" 66 #include "chrome/browser/chromeos/system/device_disabling_manager.h"
(...skipping 13 matching lines...) Expand all
78 #include "chromeos/dbus/dbus_thread_manager.h" 80 #include "chromeos/dbus/dbus_thread_manager.h"
79 #include "chromeos/dbus/session_manager_client.h" 81 #include "chromeos/dbus/session_manager_client.h"
80 #include "chromeos/geolocation/simple_geolocation_provider.h" 82 #include "chromeos/geolocation/simple_geolocation_provider.h"
81 #include "chromeos/network/network_state.h" 83 #include "chromeos/network/network_state.h"
82 #include "chromeos/network/network_state_handler.h" 84 #include "chromeos/network/network_state_handler.h"
83 #include "chromeos/network/portal_detector/network_portal_detector.h" 85 #include "chromeos/network/portal_detector/network_portal_detector.h"
84 #include "chromeos/settings/cros_settings_names.h" 86 #include "chromeos/settings/cros_settings_names.h"
85 #include "chromeos/settings/cros_settings_provider.h" 87 #include "chromeos/settings/cros_settings_provider.h"
86 #include "chromeos/settings/timezone_settings.h" 88 #include "chromeos/settings/timezone_settings.h"
87 #include "chromeos/timezone/timezone_provider.h" 89 #include "chromeos/timezone/timezone_provider.h"
90 #include "components/arc/arc_bridge_service.h"
91 #include "components/arc/arc_service_manager.h"
88 #include "components/crash/content/app/breakpad_linux.h" 92 #include "components/crash/content/app/breakpad_linux.h"
89 #include "components/pairing/bluetooth_controller_pairing_controller.h" 93 #include "components/pairing/bluetooth_controller_pairing_controller.h"
90 #include "components/pairing/bluetooth_host_pairing_controller.h" 94 #include "components/pairing/bluetooth_host_pairing_controller.h"
91 #include "components/pairing/shark_connection_listener.h" 95 #include "components/pairing/shark_connection_listener.h"
92 #include "components/prefs/pref_registry_simple.h" 96 #include "components/prefs/pref_registry_simple.h"
93 #include "components/prefs/pref_service.h" 97 #include "components/prefs/pref_service.h"
94 #include "components/user_manager/user_manager.h" 98 #include "components/user_manager/user_manager.h"
95 #include "content/public/browser/browser_thread.h" 99 #include "content/public/browser/browser_thread.h"
96 #include "content/public/browser/notification_types.h" 100 #include "content/public/browser/notification_types.h"
97 #include "ui/base/accelerators/accelerator.h" 101 #include "ui/base/accelerators/accelerator.h"
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 } 421 }
418 return new HostPairingScreen(this, this, 422 return new HostPairingScreen(this, this,
419 oobe_ui_->GetHostPairingScreenView(), 423 oobe_ui_->GetHostPairingScreenView(),
420 remora_controller_.get()); 424 remora_controller_.get());
421 } else if (screen == OobeScreen::SCREEN_DEVICE_DISABLED) { 425 } else if (screen == OobeScreen::SCREEN_DEVICE_DISABLED) {
422 return new DeviceDisabledScreen(this, 426 return new DeviceDisabledScreen(this,
423 oobe_ui_->GetDeviceDisabledScreenView()); 427 oobe_ui_->GetDeviceDisabledScreenView());
424 } else if (screen == OobeScreen::SCREEN_ENCRYPTION_MIGRATION) { 428 } else if (screen == OobeScreen::SCREEN_ENCRYPTION_MIGRATION) {
425 return new EncryptionMigrationScreen( 429 return new EncryptionMigrationScreen(
426 this, oobe_ui_->GetEncryptionMigrationScreenView()); 430 this, oobe_ui_->GetEncryptionMigrationScreenView());
431 } else if (screen == OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP) {
432 return new VoiceInteractionValuePropScreen(
433 this, oobe_ui_->GetVoiceInteractionValuePropScreenView());
427 } 434 }
428 435
429 return nullptr; 436 return nullptr;
430 } 437 }
431 438
432 void WizardController::ShowNetworkScreen() { 439 void WizardController::ShowNetworkScreen() {
433 VLOG(1) << "Showing network screen."; 440 VLOG(1) << "Showing network screen.";
434 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_OOBE_NETWORK); 441 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_OOBE_NETWORK);
435 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_NETWORK)); 442 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_NETWORK));
436 443
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 ShowArcTermsOfServiceScreen(); 545 ShowArcTermsOfServiceScreen();
539 return; 546 return;
540 } 547 }
541 548
542 VLOG(1) << "Showing Terms of Service screen."; 549 VLOG(1) << "Showing Terms of Service screen.";
543 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_TERMS_OF_SERVICE); 550 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_TERMS_OF_SERVICE);
544 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_TERMS_OF_SERVICE)); 551 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_TERMS_OF_SERVICE));
545 } 552 }
546 553
547 void WizardController::ShowArcTermsOfServiceScreen() { 554 void WizardController::ShowArcTermsOfServiceScreen() {
548 bool show_arc_terms = false; 555 if (ShouldShowArcTerms()) {
549 const Profile* profile = ProfileManager::GetActiveUserProfile();
550
551 const base::CommandLine* command_line =
552 base::CommandLine::ForCurrentProcess();
553 if (!command_line->HasSwitch(chromeos::switches::kEnableArcOOBEOptIn)) {
554 VLOG(1) << "Skip ARC Terms of Service screen because ARC OOBE OptIn is "
555 << "disabled.";
556 } else if (!user_manager::UserManager::Get()->IsUserLoggedIn()) {
557 VLOG(1) << "Skip ARC Terms of Service screen because user is not "
558 << "logged in.";
559 } else if (!arc::IsArcAllowedForProfile(profile)) {
560 VLOG(1) << "Skip ARC Terms of Service screen because ARC is not allowed.";
561 } else if (profile->GetPrefs()->IsManagedPreference(prefs::kArcEnabled) &&
562 !profile->GetPrefs()->GetBoolean(prefs::kArcEnabled)) {
563 VLOG(1) << "Skip ARC Terms of Service screen because ARC is disabled.";
564 } else {
565 show_arc_terms = true;
566 }
567
568 if (show_arc_terms) {
569 VLOG(1) << "Showing ARC Terms of Service screen."; 556 VLOG(1) << "Showing ARC Terms of Service screen.";
570 UpdateStatusAreaVisibilityForScreen( 557 UpdateStatusAreaVisibilityForScreen(
571 OobeScreen::SCREEN_ARC_TERMS_OF_SERVICE); 558 OobeScreen::SCREEN_ARC_TERMS_OF_SERVICE);
572 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_ARC_TERMS_OF_SERVICE)); 559 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_ARC_TERMS_OF_SERVICE));
573 } else { 560 } else {
574 ShowUserImageScreen(); 561 ShowUserImageScreen();
575 } 562 }
576 } 563 }
577 564
578 void WizardController::ShowWrongHWIDScreen() { 565 void WizardController::ShowWrongHWIDScreen() {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_DEVICE_DISABLED); 620 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_DEVICE_DISABLED);
634 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_DEVICE_DISABLED)); 621 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_DEVICE_DISABLED));
635 } 622 }
636 623
637 void WizardController::ShowEncryptionMigrationScreen() { 624 void WizardController::ShowEncryptionMigrationScreen() {
638 VLOG(1) << "Showing encryption migration screen."; 625 VLOG(1) << "Showing encryption migration screen.";
639 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_ENCRYPTION_MIGRATION); 626 UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_ENCRYPTION_MIGRATION);
640 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_ENCRYPTION_MIGRATION)); 627 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_ENCRYPTION_MIGRATION));
641 } 628 }
642 629
630 void WizardController::ShowVoiceInteractionValuePropScreen() {
631 if (ShouldShowVoiceInteractionValueProp()) {
632 VLOG(1) << "Showing voice interaction value prop screen.";
633 UpdateStatusAreaVisibilityForScreen(
634 OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP);
635 SetCurrentScreen(
636 GetScreen(OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP));
637 } else {
638 OnOobeFlowFinished();
639 }
640 }
641
643 void WizardController::SkipToLoginForTesting( 642 void WizardController::SkipToLoginForTesting(
644 const LoginScreenContext& context) { 643 const LoginScreenContext& context) {
645 VLOG(1) << "SkipToLoginForTesting."; 644 VLOG(1) << "SkipToLoginForTesting.";
646 StartupUtils::MarkEulaAccepted(); 645 StartupUtils::MarkEulaAccepted();
647 PerformPostEulaActions(); 646 PerformPostEulaActions();
648 OnDeviceDisabledChecked(false /* device_disabled */); 647 OnDeviceDisabledChecked(false /* device_disabled */);
649 } 648 }
650 649
651 pairing_chromeos::SharkConnectionListener* 650 pairing_chromeos::SharkConnectionListener*
652 WizardController::GetSharkConnectionListenerForTesting() { 651 WizardController::GetSharkConnectionListenerForTesting() {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 755
757 void WizardController::OnUserImageSelected() { 756 void WizardController::OnUserImageSelected() {
758 if (user_image_screen_return_to_previous_hack_) { 757 if (user_image_screen_return_to_previous_hack_) {
759 user_image_screen_return_to_previous_hack_ = false; 758 user_image_screen_return_to_previous_hack_ = false;
760 DCHECK(previous_screen_); 759 DCHECK(previous_screen_);
761 if (previous_screen_) { 760 if (previous_screen_) {
762 SetCurrentScreen(previous_screen_); 761 SetCurrentScreen(previous_screen_);
763 return; 762 return;
764 } 763 }
765 } 764 }
766 if (!time_oobe_started_.is_null()) { 765 ShowVoiceInteractionValuePropScreen();
767 base::TimeDelta delta = base::Time::Now() - time_oobe_started_;
768 UMA_HISTOGRAM_CUSTOM_TIMES(
769 "OOBE.BootToSignInCompleted",
770 delta,
771 base::TimeDelta::FromMilliseconds(10),
772 base::TimeDelta::FromMinutes(30),
773 100);
774 time_oobe_started_ = base::Time();
775 }
776
777 // Launch browser and delete login host controller.
778 BrowserThread::PostTask(
779 BrowserThread::UI, FROM_HERE,
780 base::Bind(&UserSessionManager::DoBrowserLaunch,
781 base::Unretained(UserSessionManager::GetInstance()),
782 ProfileManager::GetActiveUserProfile(), host_));
783 host_ = nullptr;
784 } 766 }
785 767
786 void WizardController::OnUserImageSkipped() { 768 void WizardController::OnUserImageSkipped() {
787 OnUserImageSelected(); 769 OnUserImageSelected();
788 } 770 }
789 771
790 void WizardController::OnEnrollmentDone() { 772 void WizardController::OnEnrollmentDone() {
791 PerformOOBECompletedActions(); 773 PerformOOBECompletedActions();
792 774
793 // Restart to make the login page pick up the policy changes resulting from 775 // Restart to make the login page pick up the policy changes resulting from
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 // of serice. 826 // of serice.
845 ShowArcTermsOfServiceScreen(); 827 ShowArcTermsOfServiceScreen();
846 } 828 }
847 829
848 void WizardController::OnArcTermsOfServiceFinished() { 830 void WizardController::OnArcTermsOfServiceFinished() {
849 // If the user finished with the PlayStore Terms of Service, advance to the 831 // If the user finished with the PlayStore Terms of Service, advance to the
850 // user image screen. 832 // user image screen.
851 ShowUserImageScreen(); 833 ShowUserImageScreen();
852 } 834 }
853 835
836 void WizardController::OnVoiceInteractionValuePropSkipped() {
837 OnOobeFlowFinished();
838 }
839
840 void WizardController::OnVoiceInteractionValuePropAccepted() {
841 // Start voice interaction setup wizard in container
842 arc::ArcVoiceInteractionFrameworkService* service =
843 arc::ArcServiceManager::Get()
844 ->GetService<arc::ArcVoiceInteractionFrameworkService>();
845 if (service)
846 service->StartVoiceInteractionSetupWizard();
847 OnOobeFlowFinished();
848 }
849
854 void WizardController::OnControllerPairingFinished() { 850 void WizardController::OnControllerPairingFinished() {
855 ShowAutoEnrollmentCheckScreen(); 851 ShowAutoEnrollmentCheckScreen();
856 } 852 }
857 853
858 void WizardController::OnAutoEnrollmentCheckCompleted() { 854 void WizardController::OnAutoEnrollmentCheckCompleted() {
859 // Check whether the device is disabled. OnDeviceDisabledChecked() will be 855 // Check whether the device is disabled. OnDeviceDisabledChecked() will be
860 // invoked when the result of this check is known. Until then, the current 856 // invoked when the result of this check is known. Until then, the current
861 // screen will remain visible and will continue showing a spinner. 857 // screen will remain visible and will continue showing a spinner.
862 g_browser_process->platform_part()->device_disabling_manager()-> 858 g_browser_process->platform_part()->device_disabling_manager()->
863 CheckWhetherDeviceDisabledDuringOOBE(base::Bind( 859 CheckWhetherDeviceDisabledDuringOOBE(base::Bind(
864 &WizardController::OnDeviceDisabledChecked, 860 &WizardController::OnDeviceDisabledChecked,
865 weak_factory_.GetWeakPtr())); 861 weak_factory_.GetWeakPtr()));
866 } 862 }
867 863
864 void WizardController::OnOobeFlowFinished() {
865 if (!time_oobe_started_.is_null()) {
866 base::TimeDelta delta = base::Time::Now() - time_oobe_started_;
867 UMA_HISTOGRAM_CUSTOM_TIMES("OOBE.BootToSignInCompleted", delta,
868 base::TimeDelta::FromMilliseconds(10),
869 base::TimeDelta::FromMinutes(30), 100);
870 time_oobe_started_ = base::Time();
871 }
872
873 // Launch browser and delete login host controller.
874 BrowserThread::PostTask(
875 BrowserThread::UI, FROM_HERE,
876 base::Bind(&UserSessionManager::DoBrowserLaunch,
877 base::Unretained(UserSessionManager::GetInstance()),
878 ProfileManager::GetActiveUserProfile(), host_));
879 host_ = nullptr;
880 }
881
868 void WizardController::OnDeviceDisabledChecked(bool device_disabled) { 882 void WizardController::OnDeviceDisabledChecked(bool device_disabled) {
869 prescribed_enrollment_config_ = g_browser_process->platform_part() 883 prescribed_enrollment_config_ = g_browser_process->platform_part()
870 ->browser_policy_connector_chromeos() 884 ->browser_policy_connector_chromeos()
871 ->GetPrescribedEnrollmentConfig(); 885 ->GetPrescribedEnrollmentConfig();
872 if (device_disabled) { 886 if (device_disabled) {
873 ShowDeviceDisabledScreen(); 887 ShowDeviceDisabledScreen();
874 } else if (skip_update_enroll_after_eula_ || 888 } else if (skip_update_enroll_after_eula_ ||
875 prescribed_enrollment_config_.should_enroll()) { 889 prescribed_enrollment_config_.should_enroll()) {
876 StartEnrollmentScreen(skip_update_enroll_after_eula_); 890 StartEnrollmentScreen(skip_update_enroll_after_eula_);
877 } else { 891 } else {
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 } else if (screen == OobeScreen::SCREEN_OOBE_HID_DETECTION) { 1096 } else if (screen == OobeScreen::SCREEN_OOBE_HID_DETECTION) {
1083 ShowHIDDetectionScreen(); 1097 ShowHIDDetectionScreen();
1084 } else if (screen == OobeScreen::SCREEN_OOBE_CONTROLLER_PAIRING) { 1098 } else if (screen == OobeScreen::SCREEN_OOBE_CONTROLLER_PAIRING) {
1085 ShowControllerPairingScreen(); 1099 ShowControllerPairingScreen();
1086 } else if (screen == OobeScreen::SCREEN_OOBE_HOST_PAIRING) { 1100 } else if (screen == OobeScreen::SCREEN_OOBE_HOST_PAIRING) {
1087 ShowHostPairingScreen(); 1101 ShowHostPairingScreen();
1088 } else if (screen == OobeScreen::SCREEN_DEVICE_DISABLED) { 1102 } else if (screen == OobeScreen::SCREEN_DEVICE_DISABLED) {
1089 ShowDeviceDisabledScreen(); 1103 ShowDeviceDisabledScreen();
1090 } else if (screen == OobeScreen::SCREEN_ENCRYPTION_MIGRATION) { 1104 } else if (screen == OobeScreen::SCREEN_ENCRYPTION_MIGRATION) {
1091 ShowEncryptionMigrationScreen(); 1105 ShowEncryptionMigrationScreen();
1106 } else if (screen == OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP) {
1107 ShowVoiceInteractionValuePropScreen();
1092 } else if (screen != OobeScreen::SCREEN_TEST_NO_WINDOW) { 1108 } else if (screen != OobeScreen::SCREEN_TEST_NO_WINDOW) {
1093 if (is_out_of_box_) { 1109 if (is_out_of_box_) {
1094 time_oobe_started_ = base::Time::Now(); 1110 time_oobe_started_ = base::Time::Now();
1095 if (IsRemoraPairingOobe() || IsControllerDetected()) { 1111 if (IsRemoraPairingOobe() || IsControllerDetected()) {
1096 ShowHostPairingScreen(); 1112 ShowHostPairingScreen();
1097 } else if (CanShowHIDDetectionScreen()) { 1113 } else if (CanShowHIDDetectionScreen()) {
1098 hid_screen_ = GetScreen(OobeScreen::SCREEN_OOBE_HID_DETECTION); 1114 hid_screen_ = GetScreen(OobeScreen::SCREEN_OOBE_HID_DETECTION);
1099 base::Callback<void(bool)> on_check = base::Bind( 1115 base::Callback<void(bool)> on_check = base::Bind(
1100 &WizardController::OnHIDScreenNecessityCheck, 1116 &WizardController::OnHIDScreenNecessityCheck,
1101 weak_factory_.GetWeakPtr()); 1117 weak_factory_.GetWeakPtr());
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 break; 1206 break;
1191 case ScreenExitCode::ARC_TERMS_OF_SERVICE_FINISHED: 1207 case ScreenExitCode::ARC_TERMS_OF_SERVICE_FINISHED:
1192 OnArcTermsOfServiceFinished(); 1208 OnArcTermsOfServiceFinished();
1193 break; 1209 break;
1194 case ScreenExitCode::WRONG_HWID_WARNING_SKIPPED: 1210 case ScreenExitCode::WRONG_HWID_WARNING_SKIPPED:
1195 OnWrongHWIDWarningSkipped(); 1211 OnWrongHWIDWarningSkipped();
1196 break; 1212 break;
1197 case ScreenExitCode::CONTROLLER_PAIRING_FINISHED: 1213 case ScreenExitCode::CONTROLLER_PAIRING_FINISHED:
1198 OnControllerPairingFinished(); 1214 OnControllerPairingFinished();
1199 break; 1215 break;
1216 case ScreenExitCode::VOICE_INTERACTION_VALUE_PROP_SKIPPED:
1217 OnVoiceInteractionValuePropSkipped();
1218 break;
1219 case ScreenExitCode::VOICE_INTERACTION_VALUE_PROP_ACCEPTED:
1220 OnVoiceInteractionValuePropAccepted();
1221 break;
1200 default: 1222 default:
1201 NOTREACHED(); 1223 NOTREACHED();
1202 } 1224 }
1203 } 1225 }
1204 1226
1205 void WizardController::ShowErrorScreen() { 1227 void WizardController::ShowErrorScreen() {
1206 VLOG(1) << "Showing error screen."; 1228 VLOG(1) << "Showing error screen.";
1207 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_ERROR_MESSAGE)); 1229 SetCurrentScreen(GetScreen(OobeScreen::SCREEN_ERROR_MESSAGE));
1208 } 1230 }
1209 1231
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 1509
1488 on_timezone_resolved_for_testing_ = callback; 1510 on_timezone_resolved_for_testing_ = callback;
1489 return true; 1511 return true;
1490 } 1512 }
1491 1513
1492 bool WizardController::IsRemoraPairingOobe() const { 1514 bool WizardController::IsRemoraPairingOobe() const {
1493 return base::CommandLine::ForCurrentProcess()->HasSwitch( 1515 return base::CommandLine::ForCurrentProcess()->HasSwitch(
1494 switches::kHostPairingOobe); 1516 switches::kHostPairingOobe);
1495 } 1517 }
1496 1518
1519 bool WizardController::ShouldShowArcTerms() const {
1520 const base::CommandLine* command_line =
1521 base::CommandLine::ForCurrentProcess();
1522 if (!command_line->HasSwitch(chromeos::switches::kEnableArcOOBEOptIn)) {
1523 VLOG(1) << "Skip ARC Terms of Service screen because ARC OOBE OptIn is "
1524 << "disabled.";
1525 return false;
1526 }
1527 if (!user_manager::UserManager::Get()->IsUserLoggedIn()) {
1528 VLOG(1) << "Skip ARC Terms of Service screen because user is not "
1529 << "logged in.";
1530 return false;
1531 }
1532
1533 const Profile* profile = ProfileManager::GetActiveUserProfile();
1534 if (!arc::IsArcAllowedForProfile(profile)) {
1535 VLOG(1) << "Skip ARC Terms of Service screen because ARC is not allowed.";
1536 return false;
1537 }
1538 if (profile->GetPrefs()->IsManagedPreference(prefs::kArcEnabled) &&
1539 !profile->GetPrefs()->GetBoolean(prefs::kArcEnabled)) {
1540 VLOG(1) << "Skip ARC Terms of Service screen because ARC is disabled.";
1541 return false;
1542 }
1543 return true;
1544 }
1545
1546 bool WizardController::ShouldShowVoiceInteractionValueProp() const {
1547 if (!arc::IsArcPlayStoreEnabledForProfile(
1548 ProfileManager::GetActiveUserProfile())) {
1549 VLOG(1) << "Skip Voice Interaction Value Prop screen because Arc Terms is "
1550 << "skipped.";
1551 return false;
1552 }
1553 if (!chromeos::switches::IsVoiceInteractionEnabled()) {
1554 VLOG(1) << "Skip Voice Interaction Value Prop screen because voice "
1555 << "interaction service is disabled.";
1556 return false;
1557 }
1558 return true;
1559 }
1560
1497 void WizardController::MaybeStartListeningForSharkConnection() { 1561 void WizardController::MaybeStartListeningForSharkConnection() {
1498 // We shouldn't be here if we are running pairing OOBE already. 1562 // We shouldn't be here if we are running pairing OOBE already.
1499 if (IsControllerDetected()) 1563 if (IsControllerDetected())
1500 return; 1564 return;
1501 1565
1502 if (!shark_connection_listener_) { 1566 if (!shark_connection_listener_) {
1503 shark_connection_listener_.reset( 1567 shark_connection_listener_.reset(
1504 new pairing_chromeos::SharkConnectionListener( 1568 new pairing_chromeos::SharkConnectionListener(
1505 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), 1569 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
1506 base::Bind(&WizardController::OnSharkConnected, 1570 base::Bind(&WizardController::OnSharkConnected,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1552 SetCurrentScreen(screen); 1616 SetCurrentScreen(screen);
1553 } 1617 }
1554 1618
1555 AutoEnrollmentController* WizardController::GetAutoEnrollmentController() { 1619 AutoEnrollmentController* WizardController::GetAutoEnrollmentController() {
1556 if (!auto_enrollment_controller_) 1620 if (!auto_enrollment_controller_)
1557 auto_enrollment_controller_ = base::MakeUnique<AutoEnrollmentController>(); 1621 auto_enrollment_controller_ = base::MakeUnique<AutoEnrollmentController>();
1558 return auto_enrollment_controller_.get(); 1622 return auto_enrollment_controller_.get();
1559 } 1623 }
1560 1624
1561 } // namespace chromeos 1625 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.h ('k') | chrome/browser/chromeos/login/wizard_controller_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698