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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/wizard_controller.cc
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc
index 4470346a3ee793660ea4bacd61a0ac1b0d738cda..76a3644f3a98492a1e6bbf4443ef176d43db7d0d 100644
--- a/chrome/browser/chromeos/login/wizard_controller.cc
+++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -30,6 +30,7 @@
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
#include "chrome/browser/chromeos/arc/arc_util.h"
+#include "chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.h"
#include "chrome/browser/chromeos/customization/customization_document.h"
#include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen.h"
#include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h"
@@ -52,6 +53,7 @@
#include "chrome/browser/chromeos/login/screens/terms_of_service_screen.h"
#include "chrome/browser/chromeos/login/screens/update_screen.h"
#include "chrome/browser/chromeos/login/screens/user_image_screen.h"
+#include "chrome/browser/chromeos/login/screens/voice_interaction_value_prop_screen.h"
#include "chrome/browser/chromeos/login/screens/wrong_hwid_screen.h"
#include "chrome/browser/chromeos/login/session/user_session_manager.h"
#include "chrome/browser/chromeos/login/startup_utils.h"
@@ -85,6 +87,8 @@
#include "chromeos/settings/cros_settings_provider.h"
#include "chromeos/settings/timezone_settings.h"
#include "chromeos/timezone/timezone_provider.h"
+#include "components/arc/arc_bridge_service.h"
+#include "components/arc/arc_service_manager.h"
#include "components/crash/content/app/breakpad_linux.h"
#include "components/pairing/bluetooth_controller_pairing_controller.h"
#include "components/pairing/bluetooth_host_pairing_controller.h"
@@ -424,6 +428,9 @@ BaseScreen* WizardController::CreateScreen(OobeScreen screen) {
} else if (screen == OobeScreen::SCREEN_ENCRYPTION_MIGRATION) {
return new EncryptionMigrationScreen(
this, oobe_ui_->GetEncryptionMigrationScreenView());
+ } else if (screen == OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP) {
+ return new VoiceInteractionValuePropScreen(
+ this, oobe_ui_->GetVoiceInteractionValuePropScreenView());
}
return nullptr;
@@ -545,27 +552,7 @@ void WizardController::ShowTermsOfServiceScreen() {
}
void WizardController::ShowArcTermsOfServiceScreen() {
- bool show_arc_terms = false;
- const Profile* profile = ProfileManager::GetActiveUserProfile();
-
- const base::CommandLine* command_line =
- base::CommandLine::ForCurrentProcess();
- if (!command_line->HasSwitch(chromeos::switches::kEnableArcOOBEOptIn)) {
- VLOG(1) << "Skip ARC Terms of Service screen because ARC OOBE OptIn is "
- << "disabled.";
- } else if (!user_manager::UserManager::Get()->IsUserLoggedIn()) {
- VLOG(1) << "Skip ARC Terms of Service screen because user is not "
- << "logged in.";
- } else if (!arc::IsArcAllowedForProfile(profile)) {
- VLOG(1) << "Skip ARC Terms of Service screen because ARC is not allowed.";
- } else if (profile->GetPrefs()->IsManagedPreference(prefs::kArcEnabled) &&
- !profile->GetPrefs()->GetBoolean(prefs::kArcEnabled)) {
- VLOG(1) << "Skip ARC Terms of Service screen because ARC is disabled.";
- } else {
- show_arc_terms = true;
- }
-
- if (show_arc_terms) {
+ if (ShouldShowArcTerms()) {
VLOG(1) << "Showing ARC Terms of Service screen.";
UpdateStatusAreaVisibilityForScreen(
OobeScreen::SCREEN_ARC_TERMS_OF_SERVICE);
@@ -640,6 +627,18 @@ void WizardController::ShowEncryptionMigrationScreen() {
SetCurrentScreen(GetScreen(OobeScreen::SCREEN_ENCRYPTION_MIGRATION));
}
+void WizardController::ShowVoiceInteractionValuePropScreen() {
+ if (ShouldShowVoiceInteractionValueProp()) {
+ VLOG(1) << "Showing voice interaction value prop screen.";
+ UpdateStatusAreaVisibilityForScreen(
+ OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP);
+ SetCurrentScreen(
+ GetScreen(OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP));
+ } else {
+ OnOobeFlowFinished();
+ }
+}
+
void WizardController::SkipToLoginForTesting(
const LoginScreenContext& context) {
VLOG(1) << "SkipToLoginForTesting.";
@@ -763,24 +762,7 @@ void WizardController::OnUserImageSelected() {
return;
}
}
- if (!time_oobe_started_.is_null()) {
- base::TimeDelta delta = base::Time::Now() - time_oobe_started_;
- UMA_HISTOGRAM_CUSTOM_TIMES(
- "OOBE.BootToSignInCompleted",
- delta,
- base::TimeDelta::FromMilliseconds(10),
- base::TimeDelta::FromMinutes(30),
- 100);
- time_oobe_started_ = base::Time();
- }
-
- // Launch browser and delete login host controller.
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- base::Bind(&UserSessionManager::DoBrowserLaunch,
- base::Unretained(UserSessionManager::GetInstance()),
- ProfileManager::GetActiveUserProfile(), host_));
- host_ = nullptr;
+ ShowVoiceInteractionValuePropScreen();
}
void WizardController::OnUserImageSkipped() {
@@ -851,6 +833,20 @@ void WizardController::OnArcTermsOfServiceFinished() {
ShowUserImageScreen();
}
+void WizardController::OnVoiceInteractionValuePropSkipped() {
+ OnOobeFlowFinished();
+}
+
+void WizardController::OnVoiceInteractionValuePropAccepted() {
+ // Start voice interaction setup wizard in container
+ arc::ArcVoiceInteractionFrameworkService* service =
+ arc::ArcServiceManager::Get()
+ ->GetService<arc::ArcVoiceInteractionFrameworkService>();
+ if (service)
+ service->StartVoiceInteractionSetupWizard();
+ OnOobeFlowFinished();
+}
+
void WizardController::OnControllerPairingFinished() {
ShowAutoEnrollmentCheckScreen();
}
@@ -865,6 +861,24 @@ void WizardController::OnAutoEnrollmentCheckCompleted() {
weak_factory_.GetWeakPtr()));
}
+void WizardController::OnOobeFlowFinished() {
+ if (!time_oobe_started_.is_null()) {
+ base::TimeDelta delta = base::Time::Now() - time_oobe_started_;
+ UMA_HISTOGRAM_CUSTOM_TIMES("OOBE.BootToSignInCompleted", delta,
+ base::TimeDelta::FromMilliseconds(10),
+ base::TimeDelta::FromMinutes(30), 100);
+ time_oobe_started_ = base::Time();
+ }
+
+ // Launch browser and delete login host controller.
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&UserSessionManager::DoBrowserLaunch,
+ base::Unretained(UserSessionManager::GetInstance()),
+ ProfileManager::GetActiveUserProfile(), host_));
+ host_ = nullptr;
+}
+
void WizardController::OnDeviceDisabledChecked(bool device_disabled) {
prescribed_enrollment_config_ = g_browser_process->platform_part()
->browser_policy_connector_chromeos()
@@ -1089,6 +1103,8 @@ void WizardController::AdvanceToScreen(OobeScreen screen) {
ShowDeviceDisabledScreen();
} else if (screen == OobeScreen::SCREEN_ENCRYPTION_MIGRATION) {
ShowEncryptionMigrationScreen();
+ } else if (screen == OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP) {
+ ShowVoiceInteractionValuePropScreen();
} else if (screen != OobeScreen::SCREEN_TEST_NO_WINDOW) {
if (is_out_of_box_) {
time_oobe_started_ = base::Time::Now();
@@ -1197,6 +1213,12 @@ void WizardController::OnExit(BaseScreen& /* screen */,
case ScreenExitCode::CONTROLLER_PAIRING_FINISHED:
OnControllerPairingFinished();
break;
+ case ScreenExitCode::VOICE_INTERACTION_VALUE_PROP_SKIPPED:
+ OnVoiceInteractionValuePropSkipped();
+ break;
+ case ScreenExitCode::VOICE_INTERACTION_VALUE_PROP_ACCEPTED:
+ OnVoiceInteractionValuePropAccepted();
+ break;
default:
NOTREACHED();
}
@@ -1494,6 +1516,48 @@ bool WizardController::IsRemoraPairingOobe() const {
switches::kHostPairingOobe);
}
+bool WizardController::ShouldShowArcTerms() const {
+ const base::CommandLine* command_line =
+ base::CommandLine::ForCurrentProcess();
+ if (!command_line->HasSwitch(chromeos::switches::kEnableArcOOBEOptIn)) {
+ VLOG(1) << "Skip ARC Terms of Service screen because ARC OOBE OptIn is "
+ << "disabled.";
+ return false;
+ }
+ if (!user_manager::UserManager::Get()->IsUserLoggedIn()) {
+ VLOG(1) << "Skip ARC Terms of Service screen because user is not "
+ << "logged in.";
+ return false;
+ }
+
+ const Profile* profile = ProfileManager::GetActiveUserProfile();
+ if (!arc::IsArcAllowedForProfile(profile)) {
+ VLOG(1) << "Skip ARC Terms of Service screen because ARC is not allowed.";
+ return false;
+ }
+ if (profile->GetPrefs()->IsManagedPreference(prefs::kArcEnabled) &&
+ !profile->GetPrefs()->GetBoolean(prefs::kArcEnabled)) {
+ VLOG(1) << "Skip ARC Terms of Service screen because ARC is disabled.";
+ return false;
+ }
+ return true;
+}
+
+bool WizardController::ShouldShowVoiceInteractionValueProp() const {
+ if (!arc::IsArcPlayStoreEnabledForProfile(
+ ProfileManager::GetActiveUserProfile())) {
+ VLOG(1) << "Skip Voice Interaction Value Prop screen because Arc Terms is "
+ << "skipped.";
+ return false;
+ }
+ if (!chromeos::switches::IsVoiceInteractionEnabled()) {
+ VLOG(1) << "Skip Voice Interaction Value Prop screen because voice "
+ << "interaction service is disabled.";
+ return false;
+ }
+ return true;
+}
+
void WizardController::MaybeStartListeningForSharkConnection() {
// We shouldn't be here if we are running pairing OOBE already.
if (IsControllerDetected())
« 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