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

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

Issue 1492043002: Introduced switches for Master/Slave bootstrapping process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address dzhioev@'s comment. Created 5 years 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 | « no previous file | chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h » ('j') | 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 cceb4996f963a248a6b420958f8f8d4d56fb10a4..5cd8fc8ee09c65fc096ad750014ee04e35feae43 100644
--- a/chrome/browser/chromeos/login/wizard_controller.cc
+++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -140,6 +140,18 @@ bool IsRemoraRequisition() {
->IsRemoraRequisition();
}
+// Checks if the device is a "Slave" device in the bootstrapping process.
+bool IsBootstrappingSlave() {
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kOobeBootstrappingSlave);
+}
+
+// Checks if the device is a "Master" device in the bootstrapping process.
+bool IsBootstrappingMaster() {
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kOobeBootstrappingMaster);
+}
+
#if defined(GOOGLE_CHROME_BUILD)
void InitializeCrashReporter() {
// The crash reporter initialization needs IO to complete.
@@ -270,6 +282,11 @@ void WizardController::Init(const std::string& first_screen_name) {
}
}
+ // If the device is a Master device in bootstrapping process (mostly for demo
+ // and test purpose), start the enrollment OOBE flow.
+ if (IsBootstrappingMaster())
+ connector->GetDeviceCloudPolicyManager()->SetDeviceEnrollmentAutoStart();
+
// Use the saved screen preference from Local State.
const std::string screen_pref =
GetLocalState()->GetString(prefs::kOobeScreenPending);
@@ -585,7 +602,7 @@ void WizardController::OnUpdateCompleted() {
->browser_policy_connector_chromeos()
->GetDeviceCloudPolicyManager()
->IsSharkRequisition();
- if (is_shark) {
+ if (is_shark || IsBootstrappingMaster()) {
ShowControllerPairingScreen();
} else {
ShowAutoEnrollmentCheckScreen();
@@ -1287,7 +1304,7 @@ bool WizardController::IsHostPairingOobe() const {
}
void WizardController::MaybeStartListeningForSharkConnection() {
- if (!IsRemoraRequisition())
+ if (!IsRemoraRequisition() && !IsBootstrappingSlave())
return;
// We shouldn't be here if we are running pairing OOBE already.
@@ -1308,6 +1325,14 @@ void WizardController::OnSharkConnected(
base::MessageLoop::current()->DeleteSoon(
FROM_HERE, shark_connection_listener_.release());
shark_controller_detected_ = true;
+
+ if (IsBootstrappingSlave()) {
+ g_browser_process->platform_part()
+ ->browser_policy_connector_chromeos()
+ ->GetDeviceCloudPolicyManager()
+ ->SetDeviceEnrollmentAutoStart();
+ }
+
ShowHostPairingScreen();
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698