OLD | NEW |
---|---|
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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 return g_browser_process->local_state()->GetBoolean( | 159 return g_browser_process->local_state()->GetBoolean( |
160 prefs::kOobeControllerDetected); | 160 prefs::kOobeControllerDetected); |
161 } | 161 } |
162 | 162 |
163 void SetControllerDetectedPref(bool value) { | 163 void SetControllerDetectedPref(bool value) { |
164 PrefService* prefs = g_browser_process->local_state(); | 164 PrefService* prefs = g_browser_process->local_state(); |
165 prefs->SetBoolean(prefs::kOobeControllerDetected, value); | 165 prefs->SetBoolean(prefs::kOobeControllerDetected, value); |
166 prefs->CommitPendingWrite(); | 166 prefs->CommitPendingWrite(); |
167 } | 167 } |
168 | 168 |
169 // Checks if the device is a "slave" device in the bootstrapping process. | |
170 bool IsBootstrappingSlave() { | |
171 return g_browser_process->local_state()->GetBoolean( | |
172 prefs::kOobeBootstrappingRole); | |
173 } | |
174 | |
169 // Checks if the device is a "Master" device in the bootstrapping process. | 175 // Checks if the device is a "Master" device in the bootstrapping process. |
170 bool IsBootstrappingMaster() { | 176 bool IsBootstrappingMaster() { |
171 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 177 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
172 chromeos::switches::kOobeBootstrappingMaster); | 178 chromeos::switches::kOobeBootstrappingMaster); |
173 } | 179 } |
174 | 180 |
175 bool NetworkAllowUpdate(const chromeos::NetworkState* network) { | 181 bool NetworkAllowUpdate(const chromeos::NetworkState* network) { |
176 if (!network || !network->IsConnectedState()) | 182 if (!network || !network->IsConnectedState()) |
177 return false; | 183 return false; |
178 if (network->type() == shill::kTypeBluetooth || | 184 if (network->type() == shill::kTypeBluetooth || |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
423 return nullptr; | 429 return nullptr; |
424 } | 430 } |
425 | 431 |
426 void WizardController::ShowNetworkScreen() { | 432 void WizardController::ShowNetworkScreen() { |
427 VLOG(1) << "Showing network screen."; | 433 VLOG(1) << "Showing network screen."; |
428 // Hide the status area initially; it only appears after OOBE first animates | 434 // Hide the status area initially; it only appears after OOBE first animates |
429 // in. Keep it visible if the user goes back to the existing network screen. | 435 // in. Keep it visible if the user goes back to the existing network screen. |
430 SetStatusAreaVisible(HasScreen(kNetworkScreenName)); | 436 SetStatusAreaVisible(HasScreen(kNetworkScreenName)); |
431 SetCurrentScreen(GetScreen(kNetworkScreenName)); | 437 SetCurrentScreen(GetScreen(kNetworkScreenName)); |
432 | 438 |
433 MaybeStartListeningForSharkConnection(); | 439 if (IsBootstrappingSlave()) |
xdai1
2016/10/03 21:08:00
There are two possible screens where we listen to
achuithb
2016/10/05 22:24:10
Could you please add a comment here stating this?
xdai1
2016/10/05 23:57:29
Done.
| |
440 MaybeStartListeningForSharkConnection(); | |
434 } | 441 } |
435 | 442 |
436 void WizardController::ShowLoginScreen(const LoginScreenContext& context) { | 443 void WizardController::ShowLoginScreen(const LoginScreenContext& context) { |
437 // This may be triggered by multiply asynchronous events from the JS side. | 444 // This may be triggered by multiply asynchronous events from the JS side. |
438 if (login_screen_started_) | 445 if (login_screen_started_) |
439 return; | 446 return; |
440 | 447 |
441 if (!time_eula_accepted_.is_null()) { | 448 if (!time_eula_accepted_.is_null()) { |
442 base::TimeDelta delta = base::Time::Now() - time_eula_accepted_; | 449 base::TimeDelta delta = base::Time::Now() - time_eula_accepted_; |
443 UMA_HISTOGRAM_MEDIUM_TIMES("OOBE.EULAToSignInTime", delta); | 450 UMA_HISTOGRAM_MEDIUM_TIMES("OOBE.EULAToSignInTime", delta); |
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1431 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; | 1438 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; |
1432 } | 1439 } |
1433 | 1440 |
1434 EnrollmentScreen* screen = EnrollmentScreen::Get(this); | 1441 EnrollmentScreen* screen = EnrollmentScreen::Get(this); |
1435 screen->SetParameters(effective_config, shark_controller_.get()); | 1442 screen->SetParameters(effective_config, shark_controller_.get()); |
1436 SetStatusAreaVisible(true); | 1443 SetStatusAreaVisible(true); |
1437 SetCurrentScreen(screen); | 1444 SetCurrentScreen(screen); |
1438 } | 1445 } |
1439 | 1446 |
1440 } // namespace chromeos | 1447 } // namespace chromeos |
OLD | NEW |