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

Unified Diff: chrome/browser/chromeos/login/wizard_controller.cc

Issue 2347703002: Limit the Material Design OOBE in a way that is less fragile. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 51ea2b3a8d68fc266bda1564958ef8e0ac0c5d15..fa5e02ad910d7b65c671fd251047fd71c7683f81 100644
--- a/chrome/browser/chromeos/login/wizard_controller.cc
+++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -146,6 +146,13 @@ bool IsRemoraRequisition() {
->IsRemoraRequisition();
}
+bool IsSharkRequisition() {
+ return g_browser_process->platform_part()
+ ->browser_policy_connector_chromeos()
+ ->GetDeviceCloudPolicyManager()
+ ->IsSharkRequisition();
+}
+
// Checks if a controller device ("Master") is detected during the bootstrapping
// or shark/remora setup process.
bool IsControllerDetected() {
@@ -184,11 +191,6 @@ void InitializeCrashReporter() {
}
#endif
-bool UseMDOobe() {
- return !base::CommandLine::ForCurrentProcess()->HasSwitch(
- chromeos::switches::kDisableMdOobe);
-}
-
} // namespace
namespace chromeos {
@@ -319,9 +321,22 @@ void WizardController::Init(const std::string& first_screen_name) {
// an eligible controller is detected later.
SetControllerDetectedPref(false);
- // If flag disappeared after restart, disable.
- if (!UseMDOobe())
- GetLocalState()->SetBoolean(prefs::kOobeMdMode, false);
+ // Show Material Design unless explicitly disabled or for an untested UX,
+ // or when resuming an OOBE that had it disabled or unset. We use an if/else
+ // here to try and not set state when it is the default value so it can
+ // change and affect the OOBE again.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kDisableMdOobe))
Alexander Alekseev 2016/09/18 11:50:45 Please, add {} as we have more than one branch her
+ SetShowMdOobe(false);
+ else if ((screen_pref.empty() ||
+ GetLocalState()->HasPrefPath(prefs::kOobeMdMode)) ||
+ GetLocalState()->GetBoolean(prefs::kOobeMdMode))
+ SetShowMdOobe(true);
+
+ // TODO(drcrash): Remove this after testing (http://crbug.com/647411).
+ if (IsRemoraPairingOobe() || IsSharkRequisition() || IsRemoraRequisition()) {
+ SetShowMdOobe(false);
+ }
AdvanceToScreen(first_screen_name_);
if (!IsMachineHWIDCorrect() && !StartupUtils::IsDeviceRegistered() &&
@@ -541,6 +556,8 @@ void WizardController::ShowSupervisedUserCreationScreen() {
void WizardController::ShowHIDDetectionScreen() {
VLOG(1) << "Showing HID discovery screen.";
+ // TODO(drcrash): Remove this after testing (http://crbug.com/647411).
+ SetShowMdOobe(false); // Disable the MD OOBE from there on.
SetStatusAreaVisible(true);
SetCurrentScreen(GetScreen(kHIDDetectionScreenName));
MaybeStartListeningForSharkConnection();
@@ -629,11 +646,7 @@ void WizardController::OnConnectionFailed() {
}
void WizardController::OnUpdateCompleted() {
- const bool is_shark = g_browser_process->platform_part()
- ->browser_policy_connector_chromeos()
- ->GetDeviceCloudPolicyManager()
- ->IsSharkRequisition();
- if (is_shark || IsBootstrappingMaster()) {
+ if (IsSharkRequisition() || IsBootstrappingMaster()) {
ShowControllerPairingScreen();
} else if (IsControllerDetected()) {
ShowHostPairingScreen();
@@ -926,6 +939,10 @@ void WizardController::SetStatusAreaVisible(bool visible) {
host_->SetStatusAreaVisible(visible);
}
+void WizardController::SetShowMdOobe(bool show) {
+ GetLocalState()->SetBoolean(prefs::kOobeMdMode, show);
+}
+
void WizardController::OnHIDScreenNecessityCheck(bool screen_needed) {
if (!oobe_ui_)
return;
@@ -933,9 +950,6 @@ void WizardController::OnHIDScreenNecessityCheck(bool screen_needed) {
if (screen_needed) {
ShowHIDDetectionScreen();
} else {
- if (UseMDOobe())
- GetLocalState()->SetBoolean(prefs::kOobeMdMode, true);
-
ShowNetworkScreen();
}
}
@@ -991,9 +1005,6 @@ void WizardController::AdvanceToScreen(const std::string& screen_name) {
weak_factory_.GetWeakPtr());
oobe_ui_->GetHIDDetectionView()->CheckIsScreenRequired(on_check);
} else {
- if (UseMDOobe())
- GetLocalState()->SetBoolean(prefs::kOobeMdMode, true);
-
ShowNetworkScreen();
}
} else {
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698