| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 #include "chrome/browser/chromeos/settings/cros_settings.h" | 54 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 55 #include "chrome/browser/chromeos/timezone/timezone_provider.h" | 55 #include "chrome/browser/chromeos/timezone/timezone_provider.h" |
| 56 #include "chrome/browser/profiles/profile.h" | 56 #include "chrome/browser/profiles/profile.h" |
| 57 #include "chrome/browser/profiles/profile_manager.h" | 57 #include "chrome/browser/profiles/profile_manager.h" |
| 58 #include "chrome/browser/ui/options/options_util.h" | 58 #include "chrome/browser/ui/options/options_util.h" |
| 59 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | 59 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
| 60 #include "chrome/common/chrome_constants.h" | 60 #include "chrome/common/chrome_constants.h" |
| 61 #include "chrome/common/pref_names.h" | 61 #include "chrome/common/pref_names.h" |
| 62 #include "chromeos/audio/cras_audio_handler.h" | 62 #include "chromeos/audio/cras_audio_handler.h" |
| 63 #include "chromeos/chromeos_constants.h" | 63 #include "chromeos/chromeos_constants.h" |
| 64 #include "chromeos/chromeos_switches.h" |
| 64 #include "chromeos/dbus/dbus_thread_manager.h" | 65 #include "chromeos/dbus/dbus_thread_manager.h" |
| 65 #include "chromeos/dbus/session_manager_client.h" | 66 #include "chromeos/dbus/session_manager_client.h" |
| 66 #include "chromeos/network/network_state.h" | 67 #include "chromeos/network/network_state.h" |
| 67 #include "chromeos/network/network_state_handler.h" | 68 #include "chromeos/network/network_state_handler.h" |
| 68 #include "chromeos/settings/cros_settings_names.h" | 69 #include "chromeos/settings/cros_settings_names.h" |
| 69 #include "chromeos/settings/timezone_settings.h" | 70 #include "chromeos/settings/timezone_settings.h" |
| 70 #include "components/breakpad/app/breakpad_linux.h" | 71 #include "components/breakpad/app/breakpad_linux.h" |
| 71 #include "content/public/browser/browser_thread.h" | 72 #include "content/public/browser/browser_thread.h" |
| 72 #include "content/public/browser/notification_types.h" | 73 #include "content/public/browser/notification_types.h" |
| 73 #include "ui/base/accelerators/accelerator.h" | 74 #include "ui/base/accelerators/accelerator.h" |
| 74 #include "ui/base/l10n/l10n_util.h" | 75 #include "ui/base/l10n/l10n_util.h" |
| 75 | 76 |
| 76 using content::BrowserThread; | 77 using content::BrowserThread; |
| 77 | 78 |
| 78 namespace { | 79 namespace { |
| 79 // If reboot didn't happen, ask user to reboot device manually. | 80 // If reboot didn't happen, ask user to reboot device manually. |
| 80 const int kWaitForRebootTimeSec = 3; | 81 const int kWaitForRebootTimeSec = 3; |
| 81 | 82 |
| 82 // Interval in ms which is used for smooth screen showing. | 83 // Interval in ms which is used for smooth screen showing. |
| 83 static int kShowDelayMs = 400; | 84 static int kShowDelayMs = 400; |
| 84 | 85 |
| 85 // Total timezone resolving process timeout. | 86 // Total timezone resolving process timeout. |
| 86 const unsigned int kResolveTimeZoneTimeoutSeconds = 60; | 87 const unsigned int kResolveTimeZoneTimeoutSeconds = 60; |
| 88 |
| 89 // Checks flag for HID-detection screen show. |
| 90 bool CanShowHIDDetectionScreen() { |
| 91 return !CommandLine::ForCurrentProcess()->HasSwitch( |
| 92 chromeos::switches::kDisableHIDDetectionOnOOBE); |
| 93 } |
| 94 |
| 87 } // namespace | 95 } // namespace |
| 88 | 96 |
| 89 namespace chromeos { | 97 namespace chromeos { |
| 90 | 98 |
| 91 const char WizardController::kNetworkScreenName[] = "network"; | 99 const char WizardController::kNetworkScreenName[] = "network"; |
| 92 const char WizardController::kLoginScreenName[] = "login"; | 100 const char WizardController::kLoginScreenName[] = "login"; |
| 93 const char WizardController::kUpdateScreenName[] = "update"; | 101 const char WizardController::kUpdateScreenName[] = "update"; |
| 94 const char WizardController::kUserImageScreenName[] = "image"; | 102 const char WizardController::kUserImageScreenName[] = "image"; |
| 95 const char WizardController::kEulaScreenName[] = "eula"; | 103 const char WizardController::kEulaScreenName[] = "eula"; |
| 96 const char WizardController::kEnrollmentScreenName[] = "enroll"; | 104 const char WizardController::kEnrollmentScreenName[] = "enroll"; |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 } else if (screen_name == kWrongHWIDScreenName) { | 777 } else if (screen_name == kWrongHWIDScreenName) { |
| 770 ShowWrongHWIDScreen(); | 778 ShowWrongHWIDScreen(); |
| 771 } else if (screen_name == kLocallyManagedUserCreationScreenName) { | 779 } else if (screen_name == kLocallyManagedUserCreationScreenName) { |
| 772 ShowLocallyManagedUserCreationScreen(); | 780 ShowLocallyManagedUserCreationScreen(); |
| 773 } else if (screen_name == kAppLaunchSplashScreenName) { | 781 } else if (screen_name == kAppLaunchSplashScreenName) { |
| 774 AutoLaunchKioskApp(); | 782 AutoLaunchKioskApp(); |
| 775 } else if (screen_name == kHIDDetectionScreenName) { | 783 } else if (screen_name == kHIDDetectionScreenName) { |
| 776 ShowHIDDetectionScreen(); | 784 ShowHIDDetectionScreen(); |
| 777 } else if (screen_name != kTestNoScreenName) { | 785 } else if (screen_name != kTestNoScreenName) { |
| 778 if (is_out_of_box_) { | 786 if (is_out_of_box_) { |
| 779 ShowNetworkScreen(); | 787 if (CanShowHIDDetectionScreen()) |
| 788 ShowHIDDetectionScreen(); |
| 789 else |
| 790 ShowNetworkScreen(); |
| 780 } else { | 791 } else { |
| 781 ShowLoginScreen(LoginScreenContext()); | 792 ShowLoginScreen(LoginScreenContext()); |
| 782 } | 793 } |
| 783 } | 794 } |
| 784 } | 795 } |
| 785 | 796 |
| 786 /////////////////////////////////////////////////////////////////////////////// | 797 /////////////////////////////////////////////////////////////////////////////// |
| 787 // WizardController, chromeos::ScreenObserver overrides: | 798 // WizardController, chromeos::ScreenObserver overrides: |
| 788 void WizardController::OnExit(ExitCodes exit_code) { | 799 void WizardController::OnExit(ExitCodes exit_code) { |
| 789 VLOG(1) << "Wizard screen exit code: " << exit_code; | 800 VLOG(1) << "Wizard screen exit code: " << exit_code; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 // cancelled on destruction. | 1053 // cancelled on destruction. |
| 1043 GetTimezoneProvider()->RequestTimezone( | 1054 GetTimezoneProvider()->RequestTimezone( |
| 1044 position, | 1055 position, |
| 1045 false, // sensor | 1056 false, // sensor |
| 1046 timeout - elapsed, | 1057 timeout - elapsed, |
| 1047 base::Bind(&WizardController::OnTimezoneResolved, | 1058 base::Bind(&WizardController::OnTimezoneResolved, |
| 1048 base::Unretained(this))); | 1059 base::Unretained(this))); |
| 1049 } | 1060 } |
| 1050 | 1061 |
| 1051 } // namespace chromeos | 1062 } // namespace chromeos |
| OLD | NEW |