| 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 <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 | 10 |
| (...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 } | 1039 } |
| 1040 | 1040 |
| 1041 void WizardController::SetUsageStatisticsReporting(bool val) { | 1041 void WizardController::SetUsageStatisticsReporting(bool val) { |
| 1042 usage_statistics_reporting_ = val; | 1042 usage_statistics_reporting_ = val; |
| 1043 } | 1043 } |
| 1044 | 1044 |
| 1045 bool WizardController::GetUsageStatisticsReporting() const { | 1045 bool WizardController::GetUsageStatisticsReporting() const { |
| 1046 return usage_statistics_reporting_; | 1046 return usage_statistics_reporting_; |
| 1047 } | 1047 } |
| 1048 | 1048 |
| 1049 void WizardController::SetHostNetwork() { |
| 1050 if (!shark_controller_) |
| 1051 return; |
| 1052 NetworkScreen* network_screen = NetworkScreen::Get(this); |
| 1053 std::string onc_spec; |
| 1054 network_screen->GetConnectedWifiNetwork(&onc_spec); |
| 1055 if (!onc_spec.empty()) |
| 1056 shark_controller_->SetHostNetwork(onc_spec); |
| 1057 } |
| 1058 |
| 1049 void WizardController::SetHostConfiguration() { | 1059 void WizardController::SetHostConfiguration() { |
| 1050 if (shark_controller_) { | 1060 if (!shark_controller_) |
| 1051 NetworkScreen* network_screen = NetworkScreen::Get(this); | 1061 return; |
| 1052 shark_controller_->SetHostConfiguration( | 1062 NetworkScreen* network_screen = NetworkScreen::Get(this); |
| 1053 true, // Eula must be accepted before we get this far. | 1063 shark_controller_->SetHostConfiguration( |
| 1054 network_screen->GetApplicationLocale(), network_screen->GetTimezone(), | 1064 true, // Eula must be accepted before we get this far. |
| 1055 GetUsageStatisticsReporting(), network_screen->GetInputMethod()); | 1065 network_screen->GetApplicationLocale(), network_screen->GetTimezone(), |
| 1056 } | 1066 GetUsageStatisticsReporting(), network_screen->GetInputMethod()); |
| 1057 } | 1067 } |
| 1058 | 1068 |
| 1059 void WizardController::ConfigureHostRequested( | 1069 void WizardController::ConfigureHostRequested( |
| 1060 bool accepted_eula, | 1070 bool accepted_eula, |
| 1061 const std::string& lang, | 1071 const std::string& lang, |
| 1062 const std::string& timezone, | 1072 const std::string& timezone, |
| 1063 bool send_reports, | 1073 bool send_reports, |
| 1064 const std::string& keyboard_layout) { | 1074 const std::string& keyboard_layout) { |
| 1065 VLOG(1) << "ConfigureHost locale=" << lang << ", timezone=" << timezone | 1075 VLOG(1) << "ConfigureHost locale=" << lang << ", timezone=" << timezone |
| 1066 << ", keyboard_layout=" << keyboard_layout; | 1076 << ", keyboard_layout=" << keyboard_layout; |
| 1067 if (accepted_eula) // Always true. | 1077 if (accepted_eula) // Always true. |
| 1068 StartupUtils::MarkEulaAccepted(); | 1078 StartupUtils::MarkEulaAccepted(); |
| 1069 SetUsageStatisticsReporting(send_reports); | 1079 SetUsageStatisticsReporting(send_reports); |
| 1070 | 1080 |
| 1071 NetworkScreen* network_screen = NetworkScreen::Get(this); | 1081 NetworkScreen* network_screen = NetworkScreen::Get(this); |
| 1072 network_screen->SetApplicationLocale(lang); | 1082 network_screen->SetApplicationLocale(lang); |
| 1073 network_screen->SetTimezone(timezone); | 1083 network_screen->SetTimezone(timezone); |
| 1074 network_screen->SetInputMethod(keyboard_layout); | 1084 network_screen->SetInputMethod(keyboard_layout); |
| 1075 } | 1085 } |
| 1076 | 1086 |
| 1077 void WizardController::AddNetworkRequested(const std::string& onc_spec) { | 1087 void WizardController::AddNetworkRequested(const std::string& onc_spec) { |
| 1078 NetworkScreen* network_screen = NetworkScreen::Get(this); | 1088 NetworkScreen* network_screen = NetworkScreen::Get(this); |
| 1079 network_screen->CreateNetworkFromOnc(onc_spec); | 1089 network_screen->CreateAndConnectNetworkFromOnc(onc_spec); |
| 1080 } | 1090 } |
| 1081 | 1091 |
| 1082 void WizardController::OnEnableDebuggingScreenRequested() { | 1092 void WizardController::OnEnableDebuggingScreenRequested() { |
| 1083 if (!login_screen_started()) | 1093 if (!login_screen_started()) |
| 1084 AdvanceToScreen(WizardController::kEnableDebuggingScreenName); | 1094 AdvanceToScreen(WizardController::kEnableDebuggingScreenName); |
| 1085 } | 1095 } |
| 1086 | 1096 |
| 1087 void WizardController::OnAccessibilityStatusChanged( | 1097 void WizardController::OnAccessibilityStatusChanged( |
| 1088 const AccessibilityStatusEventDetails& details) { | 1098 const AccessibilityStatusEventDetails& details) { |
| 1089 enum AccessibilityNotificationType type = details.notification_type; | 1099 enum AccessibilityNotificationType type = details.notification_type; |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1317 } | 1327 } |
| 1318 | 1328 |
| 1319 EnrollmentScreen* screen = EnrollmentScreen::Get(this); | 1329 EnrollmentScreen* screen = EnrollmentScreen::Get(this); |
| 1320 screen->SetParameters(effective_config, shark_controller_.get(), | 1330 screen->SetParameters(effective_config, shark_controller_.get(), |
| 1321 remora_controller_.get()); | 1331 remora_controller_.get()); |
| 1322 SetStatusAreaVisible(true); | 1332 SetStatusAreaVisible(true); |
| 1323 SetCurrentScreen(screen); | 1333 SetCurrentScreen(screen); |
| 1324 } | 1334 } |
| 1325 | 1335 |
| 1326 } // namespace chromeos | 1336 } // namespace chromeos |
| OLD | NEW |