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

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

Issue 673813003: SetHostConfiguration() and ConfigureHost() are moved from ScreenObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 6 years, 1 month 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
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 <stdlib.h> 8 #include <stdlib.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 10
(...skipping 14 matching lines...) Expand all
25 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 25 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
26 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" 26 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
27 #include "chrome/browser/chromeos/customization_document.h" 27 #include "chrome/browser/chromeos/customization_document.h"
28 #include "chrome/browser/chromeos/geolocation/simple_geolocation_provider.h" 28 #include "chrome/browser/chromeos/geolocation/simple_geolocation_provider.h"
29 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen. h" 29 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen. h"
30 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" 30 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h"
31 #include "chrome/browser/chromeos/login/existing_user_controller.h" 31 #include "chrome/browser/chromeos/login/existing_user_controller.h"
32 #include "chrome/browser/chromeos/login/helper.h" 32 #include "chrome/browser/chromeos/login/helper.h"
33 #include "chrome/browser/chromeos/login/hwid_checker.h" 33 #include "chrome/browser/chromeos/login/hwid_checker.h"
34 #include "chrome/browser/chromeos/login/login_utils.h" 34 #include "chrome/browser/chromeos/login/login_utils.h"
35 #include "chrome/browser/chromeos/login/screens/controller_pairing_screen.h"
36 #include "chrome/browser/chromeos/login/screens/device_disabled_screen.h" 35 #include "chrome/browser/chromeos/login/screens/device_disabled_screen.h"
37 #include "chrome/browser/chromeos/login/screens/error_screen.h" 36 #include "chrome/browser/chromeos/login/screens/error_screen.h"
38 #include "chrome/browser/chromeos/login/screens/eula_screen.h" 37 #include "chrome/browser/chromeos/login/screens/eula_screen.h"
39 #include "chrome/browser/chromeos/login/screens/hid_detection_screen.h" 38 #include "chrome/browser/chromeos/login/screens/hid_detection_screen.h"
40 #include "chrome/browser/chromeos/login/screens/host_pairing_screen.h"
41 #include "chrome/browser/chromeos/login/screens/kiosk_autolaunch_screen.h" 39 #include "chrome/browser/chromeos/login/screens/kiosk_autolaunch_screen.h"
42 #include "chrome/browser/chromeos/login/screens/kiosk_enable_screen.h" 40 #include "chrome/browser/chromeos/login/screens/kiosk_enable_screen.h"
43 #include "chrome/browser/chromeos/login/screens/network_screen.h" 41 #include "chrome/browser/chromeos/login/screens/network_screen.h"
44 #include "chrome/browser/chromeos/login/screens/reset_screen.h" 42 #include "chrome/browser/chromeos/login/screens/reset_screen.h"
45 #include "chrome/browser/chromeos/login/screens/terms_of_service_screen.h" 43 #include "chrome/browser/chromeos/login/screens/terms_of_service_screen.h"
46 #include "chrome/browser/chromeos/login/screens/update_screen.h" 44 #include "chrome/browser/chromeos/login/screens/update_screen.h"
47 #include "chrome/browser/chromeos/login/screens/user_image_screen.h" 45 #include "chrome/browser/chromeos/login/screens/user_image_screen.h"
48 #include "chrome/browser/chromeos/login/screens/wrong_hwid_screen.h" 46 #include "chrome/browser/chromeos/login/screens/wrong_hwid_screen.h"
49 #include "chrome/browser/chromeos/login/startup_utils.h" 47 #include "chrome/browser/chromeos/login/startup_utils.h"
50 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_scre en.h" 48 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_scre en.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 return new chromeos::HIDDetectionScreen( 331 return new chromeos::HIDDetectionScreen(
334 this, oobe_display_->GetHIDDetectionScreenActor()); 332 this, oobe_display_->GetHIDDetectionScreenActor());
335 } else if (screen_name == kAutoEnrollmentCheckScreenName) { 333 } else if (screen_name == kAutoEnrollmentCheckScreenName) {
336 return new chromeos::AutoEnrollmentCheckScreen( 334 return new chromeos::AutoEnrollmentCheckScreen(
337 this, oobe_display_->GetAutoEnrollmentCheckScreenActor()); 335 this, oobe_display_->GetAutoEnrollmentCheckScreenActor());
338 } else if (screen_name == kControllerPairingScreenName) { 336 } else if (screen_name == kControllerPairingScreenName) {
339 if (!shark_controller_) { 337 if (!shark_controller_) {
340 shark_controller_.reset( 338 shark_controller_.reset(
341 new pairing_chromeos::BluetoothControllerPairingController()); 339 new pairing_chromeos::BluetoothControllerPairingController());
342 } 340 }
343 return new ControllerPairingScreen( 341 scoped_ptr<chromeos::ControllerPairingScreen> screen(
344 this, oobe_display_->GetControllerPairingScreenActor(), 342 new ControllerPairingScreen(
345 shark_controller_.get()); 343 this,
344 oobe_display_->GetControllerPairingScreenActor(),
345 shark_controller_.get()));
346 screen->SetDelegate(this);
347 return screen.release();
346 } else if (screen_name == kHostPairingScreenName) { 348 } else if (screen_name == kHostPairingScreenName) {
347 if (!remora_controller_) { 349 if (!remora_controller_) {
348 remora_controller_.reset( 350 remora_controller_.reset(
349 new pairing_chromeos::BluetoothHostPairingController()); 351 new pairing_chromeos::BluetoothHostPairingController());
350 remora_controller_->StartPairing(); 352 remora_controller_->StartPairing();
351 } 353 }
352 return new HostPairingScreen(this, 354 scoped_ptr<HostPairingScreen> screen(
353 oobe_display_->GetHostPairingScreenActor(), 355 new HostPairingScreen(this,
354 remora_controller_.get()); 356 oobe_display_->GetHostPairingScreenActor(),
357 remora_controller_.get()));
358 screen->SetDelegate(this);
359 return screen.release();
355 } else if (screen_name == kDeviceDisabledScreenName) { 360 } else if (screen_name == kDeviceDisabledScreenName) {
356 return new chromeos::DeviceDisabledScreen( 361 return new chromeos::DeviceDisabledScreen(
357 this, oobe_display_->GetDeviceDisabledScreenActor()); 362 this, oobe_display_->GetDeviceDisabledScreenActor());
358 } 363 }
359 364
360 return NULL; 365 return NULL;
361 } 366 }
362 367
363 void WizardController::ShowNetworkScreen() { 368 void WizardController::ShowNetworkScreen() {
364 VLOG(1) << "Showing network screen."; 369 VLOG(1) << "Showing network screen.";
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 } 1036 }
1032 1037
1033 void WizardController::SetUsageStatisticsReporting(bool val) { 1038 void WizardController::SetUsageStatisticsReporting(bool val) {
1034 usage_statistics_reporting_ = val; 1039 usage_statistics_reporting_ = val;
1035 } 1040 }
1036 1041
1037 bool WizardController::GetUsageStatisticsReporting() const { 1042 bool WizardController::GetUsageStatisticsReporting() const {
1038 return usage_statistics_reporting_; 1043 return usage_statistics_reporting_;
1039 } 1044 }
1040 1045
1046 void WizardController::SetHostConfiguration() {
1047 if (shark_controller_) {
1048 NetworkScreenActor* network_actor = oobe_display_->GetNetworkScreenActor();
1049 shark_controller_->SetHostConfiguration(
1050 true, // Eula must be accepted before we get this far.
1051 network_actor->GetApplicationLocale(),
1052 network_actor->GetTimezone(),
1053 GetUsageStatisticsReporting(),
1054 network_actor->GetInputMethod());
1055 }
1056 }
1057
1058 void WizardController::ConfigureHost(bool accepted_eula,
1059 const std::string& lang,
1060 const std::string& timezone,
1061 bool send_reports,
1062 const std::string& keyboard_layout) {
1063 VLOG(1) << "ConfigureHost locale=" << lang << ", timezone=" << timezone
1064 << ", keyboard_layout=" << keyboard_layout;
1065 if (accepted_eula) // Always true.
1066 StartupUtils::MarkEulaAccepted();
1067 SetUsageStatisticsReporting(send_reports);
1068 NetworkScreenActor* network_actor = oobe_display_->GetNetworkScreenActor();
1069 network_actor->SetApplicationLocale(lang);
1070 network_actor->SetTimezone(timezone);
1071 network_actor->SetInputMethod(keyboard_layout);
1072 }
1073
1041 void WizardController::OnAccessibilityStatusChanged( 1074 void WizardController::OnAccessibilityStatusChanged(
1042 const AccessibilityStatusEventDetails& details) { 1075 const AccessibilityStatusEventDetails& details) {
1043 enum AccessibilityNotificationType type = details.notification_type; 1076 enum AccessibilityNotificationType type = details.notification_type;
1044 if (type == ACCESSIBILITY_MANAGER_SHUTDOWN) { 1077 if (type == ACCESSIBILITY_MANAGER_SHUTDOWN) {
1045 accessibility_subscription_.reset(); 1078 accessibility_subscription_.reset();
1046 return; 1079 return;
1047 } else if (type != ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK || !details.enabled) { 1080 } else if (type != ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK || !details.enabled) {
1048 return; 1081 return;
1049 } 1082 }
1050 1083
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 void WizardController::OnSharkConnected( 1299 void WizardController::OnSharkConnected(
1267 scoped_ptr<pairing_chromeos::HostPairingController> remora_controller) { 1300 scoped_ptr<pairing_chromeos::HostPairingController> remora_controller) {
1268 VLOG(1) << "OnSharkConnected"; 1301 VLOG(1) << "OnSharkConnected";
1269 remora_controller_ = remora_controller.Pass(); 1302 remora_controller_ = remora_controller.Pass();
1270 base::MessageLoop::current()->DeleteSoon( 1303 base::MessageLoop::current()->DeleteSoon(
1271 FROM_HERE, shark_connection_listener_.release()); 1304 FROM_HERE, shark_connection_listener_.release());
1272 shark_controller_detected_ = true; 1305 shark_controller_detected_ = true;
1273 ShowHostPairingScreen(); 1306 ShowHostPairingScreen();
1274 } 1307 }
1275 1308
1276 void WizardController::SetHostConfiguration() {
1277 if (shark_controller_) {
1278 NetworkScreenActor* network_actor = oobe_display_->GetNetworkScreenActor();
1279 shark_controller_->SetHostConfiguration(
1280 true, // Eula must be accepted before we get this far.
1281 network_actor->GetApplicationLocale(),
1282 network_actor->GetTimezone(),
1283 GetUsageStatisticsReporting(),
1284 network_actor->GetInputMethod());
1285 }
1286 }
1287
1288 void WizardController::ConfigureHost(bool accepted_eula,
1289 const std::string& lang,
1290 const std::string& timezone,
1291 bool send_reports,
1292 const std::string& keyboard_layout) {
1293 VLOG(1) << "ConfigureHost locale=" << lang
1294 << ", timezone=" << timezone
1295 << ", keyboard_layout=" << keyboard_layout;
1296 if (accepted_eula) // Always true.
1297 StartupUtils::MarkEulaAccepted();
1298 SetUsageStatisticsReporting(send_reports);
1299 NetworkScreenActor* network_actor = oobe_display_->GetNetworkScreenActor();
1300 network_actor->SetApplicationLocale(lang);
1301 network_actor->SetTimezone(timezone);
1302 network_actor->SetInputMethod(keyboard_layout);
1303 }
1304
1305 } // namespace chromeos 1309 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698