diff options
author | xdai <xdai@chromium.org> | 2016-03-03 13:08:46 -0800 |
---|---|---|
committer | xdai <xdai@chromium.org> | 2016-03-03 21:10:43 +0000 |
commit | 3f9af68e9892ec825152065246424a23be9ed115 (patch) | |
tree | 2cf98c84b00abd2c99ae67711981440d06cd5591 | |
parent | f1f536132b0a56d7d63df260f88207874fab5954 (diff) | |
download | chromium_src-3f9af68e9892ec825152065246424a23be9ed115.zip chromium_src-3f9af68e9892ec825152065246424a23be9ed115.tar.gz chromium_src-3f9af68e9892ec825152065246424a23be9ed115.tar.bz2 |
[Merge to M49] Don't use the saved screen preference for Slave devices during OOBE.
BUG=564370
TBR=dzhioev@chromium.org
Review URL: https://codereview.chromium.org/1708943002
Cr-Commit-Position: refs/heads/master@{#376407}
(cherry picked from commit 56bfb6d4ee4d035157401ef26ddabd7bb25b79e6)
Review URL: https://codereview.chromium.org/1762033002 .
Cr-Commit-Position: refs/branch-heads/2623@{#570}
Cr-Branched-From: 92d77538a86529ca35f9220bd3cd512cbea1f086-refs/heads/master@{#369907}
-rw-r--r-- | chrome/browser/chromeos/login/wizard_controller.cc | 15 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/wizard_controller.h | 5 |
2 files changed, 14 insertions, 6 deletions
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index e478e73..5b2b716 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc @@ -304,7 +304,8 @@ void WizardController::Init(const std::string& first_screen_name) { // Use the saved screen preference from Local State. const std::string screen_pref = GetLocalState()->GetString(prefs::kOobeScreenPending); - if (is_out_of_box_ && !screen_pref.empty() && !IsHostPairingOobe() && + if (is_out_of_box_ && !screen_pref.empty() && !IsRemoraPairingOobe() && + !IsBootstrappingSlave() && (first_screen_name.empty() || first_screen_name == WizardController::kTestNoScreenName)) { first_screen_name_ = screen_pref; @@ -950,7 +951,7 @@ void WizardController::AdvanceToScreen(const std::string& screen_name) { } else if (screen_name != kTestNoScreenName) { if (is_out_of_box_) { time_oobe_started_ = base::Time::Now(); - if (IsHostPairingOobe()) { + if (IsRemoraPairingOobe() || IsSlavePairingOobe()) { ShowHostPairingScreen(); } else if (CanShowHIDDetectionScreen()) { hid_screen_ = GetScreen(kHIDDetectionScreenName); @@ -1326,19 +1327,23 @@ bool WizardController::SetOnTimeZoneResolvedForTesting( return true; } -bool WizardController::IsHostPairingOobe() const { - return (IsRemoraRequisition() || IsBootstrappingSlave()) && +bool WizardController::IsRemoraPairingOobe() const { + return IsRemoraRequisition() && (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kHostPairingOobe) || shark_controller_detected_); } +bool WizardController::IsSlavePairingOobe() const { + return IsBootstrappingSlave() && shark_controller_detected_; +} + void WizardController::MaybeStartListeningForSharkConnection() { if (!IsRemoraRequisition() && !IsBootstrappingSlave()) return; // We shouldn't be here if we are running pairing OOBE already. - DCHECK(!IsHostPairingOobe()); + DCHECK(!IsRemoraPairingOobe() && !IsSlavePairingOobe()); if (!shark_connection_listener_) { shark_connection_listener_.reset( diff --git a/chrome/browser/chromeos/login/wizard_controller.h b/chrome/browser/chromeos/login/wizard_controller.h index b9129fb..fd3a501 100644 --- a/chrome/browser/chromeos/login/wizard_controller.h +++ b/chrome/browser/chromeos/login/wizard_controller.h @@ -311,7 +311,10 @@ class WizardController : public BaseScreenDelegate, bool SetOnTimeZoneResolvedForTesting(const base::Closure& callback); // Returns true for pairing remora OOBE. - bool IsHostPairingOobe() const; + bool IsRemoraPairingOobe() const; + + // Returns true for pairing slave OOBE. + bool IsSlavePairingOobe() const; // Starts listening for an incoming shark controller connection, if we are // running remora OOBE. |