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

Side by Side Diff: chrome/browser/chromeos/login/wizard_controller.cc

Issue 2251503002: [Bootstrapping] Update the slave device's network connectivity status correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 // Don't block the OOBE update and the following enrollment process if there 1125 // Don't block the OOBE update and the following enrollment process if there
1126 // is available and valid network already. 1126 // is available and valid network already.
1127 const chromeos::NetworkState* network_state = chromeos::NetworkHandler::Get() 1127 const chromeos::NetworkState* network_state = chromeos::NetworkHandler::Get()
1128 ->network_state_handler() 1128 ->network_state_handler()
1129 ->DefaultNetwork(); 1129 ->DefaultNetwork();
1130 if (NetworkAllowUpdate(network_state)) 1130 if (NetworkAllowUpdate(network_state))
1131 InitiateOOBEUpdate(); 1131 InitiateOOBEUpdate();
1132 } 1132 }
1133 1133
1134 void WizardController::AddNetworkRequested(const std::string& onc_spec) { 1134 void WizardController::AddNetworkRequested(const std::string& onc_spec) {
1135 remora_controller_->OnNetworkConnectivityChanged(
1136 pairing_chromeos::HostPairingController::CONNECTIVITY_CONNECTING);
1137
1135 NetworkScreen* network_screen = NetworkScreen::Get(this); 1138 NetworkScreen* network_screen = NetworkScreen::Get(this);
1136 const chromeos::NetworkState* network_state = chromeos::NetworkHandler::Get() 1139 const chromeos::NetworkState* network_state = chromeos::NetworkHandler::Get()
1137 ->network_state_handler() 1140 ->network_state_handler()
1138 ->DefaultNetwork(); 1141 ->DefaultNetwork();
1139 1142
1140 if (NetworkAllowUpdate(network_state)) { 1143 if (NetworkAllowUpdate(network_state)) {
1141 network_screen->CreateAndConnectNetworkFromOnc( 1144 network_screen->CreateAndConnectNetworkFromOnc(
1142 onc_spec, base::Bind(&base::DoNothing), base::Bind(&base::DoNothing)); 1145 onc_spec, base::Bind(&base::DoNothing), base::Bind(&base::DoNothing));
1143 } else { 1146 } else {
1144 network_screen->CreateAndConnectNetworkFromOnc( 1147 network_screen->CreateAndConnectNetworkFromOnc(
1145 onc_spec, base::Bind(&WizardController::InitiateOOBEUpdate, 1148 onc_spec, base::Bind(&WizardController::OnSetHostNetworkSuccessful,
1146 weak_factory_.GetWeakPtr()), 1149 weak_factory_.GetWeakPtr()),
1147 base::Bind(&WizardController::OnSetHostNetworkFailed, 1150 base::Bind(&WizardController::OnSetHostNetworkFailed,
1148 weak_factory_.GetWeakPtr())); 1151 weak_factory_.GetWeakPtr()));
1149 } 1152 }
1150 } 1153 }
1151 1154
1152 void WizardController::OnEnableDebuggingScreenRequested() { 1155 void WizardController::OnEnableDebuggingScreenRequested() {
1153 if (!login_screen_started()) 1156 if (!login_screen_started())
1154 AdvanceToScreen(WizardController::kEnableDebuggingScreenName); 1157 AdvanceToScreen(WizardController::kEnableDebuggingScreenName);
1155 } 1158 }
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 std::unique_ptr<pairing_chromeos::HostPairingController> 1366 std::unique_ptr<pairing_chromeos::HostPairingController>
1364 remora_controller) { 1367 remora_controller) {
1365 VLOG(1) << "OnSharkConnected"; 1368 VLOG(1) << "OnSharkConnected";
1366 remora_controller_ = std::move(remora_controller); 1369 remora_controller_ = std::move(remora_controller);
1367 base::ThreadTaskRunnerHandle::Get()->DeleteSoon( 1370 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(
1368 FROM_HERE, shark_connection_listener_.release()); 1371 FROM_HERE, shark_connection_listener_.release());
1369 SetControllerDetectedPref(true); 1372 SetControllerDetectedPref(true);
1370 ShowHostPairingScreen(); 1373 ShowHostPairingScreen();
1371 } 1374 }
1372 1375
1376 void WizardController::OnSetHostNetworkSuccessful() {
1377 remora_controller_->OnNetworkConnectivityChanged(
1378 pairing_chromeos::HostPairingController::CONNECTIVITY_CONNECTED);
1379 InitiateOOBEUpdate();
1380 }
1381
1373 void WizardController::OnSetHostNetworkFailed() { 1382 void WizardController::OnSetHostNetworkFailed() {
1374 remora_controller_->OnNetworkConnectivityChanged( 1383 remora_controller_->OnNetworkConnectivityChanged(
1375 pairing_chromeos::HostPairingController::CONNECTIVITY_NONE); 1384 pairing_chromeos::HostPairingController::CONNECTIVITY_NONE);
1376 } 1385 }
1377 1386
1378 void WizardController::StartEnrollmentScreen() { 1387 void WizardController::StartEnrollmentScreen() {
1379 VLOG(1) << "Showing enrollment screen."; 1388 VLOG(1) << "Showing enrollment screen.";
1380 1389
1381 // Determine the effective enrollment configuration. If there is a valid 1390 // Determine the effective enrollment configuration. If there is a valid
1382 // prescribed configuration, use that. If not, figure out which variant of 1391 // prescribed configuration, use that. If not, figure out which variant of
1383 // manual enrollment is taking place. 1392 // manual enrollment is taking place.
1384 policy::EnrollmentConfig effective_config = prescribed_enrollment_config_; 1393 policy::EnrollmentConfig effective_config = prescribed_enrollment_config_;
1385 if (!effective_config.should_enroll()) { 1394 if (!effective_config.should_enroll()) {
1386 effective_config.mode = 1395 effective_config.mode =
1387 prescribed_enrollment_config_.management_domain.empty() 1396 prescribed_enrollment_config_.management_domain.empty()
1388 ? policy::EnrollmentConfig::MODE_MANUAL 1397 ? policy::EnrollmentConfig::MODE_MANUAL
1389 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; 1398 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT;
1390 } 1399 }
1391 1400
1392 EnrollmentScreen* screen = EnrollmentScreen::Get(this); 1401 EnrollmentScreen* screen = EnrollmentScreen::Get(this);
1393 screen->SetParameters(effective_config, shark_controller_.get()); 1402 screen->SetParameters(effective_config, shark_controller_.get());
1394 SetStatusAreaVisible(true); 1403 SetStatusAreaVisible(true);
1395 SetCurrentScreen(screen); 1404 SetCurrentScreen(screen);
1396 } 1405 }
1397 1406
1398 } // namespace chromeos 1407 } // namespace chromeos
OLDNEW
« 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