Chromium Code Reviews| 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); | |
|
dzhioev (left Google)
2014/04/25 10:59:59
You wrote in description that several features are
merkulova
2014/04/25 11:37:20
Current state covers most of use-cases, widening p
| |
| 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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 765 } else if (screen_name == kWrongHWIDScreenName) { | 773 } else if (screen_name == kWrongHWIDScreenName) { |
| 766 ShowWrongHWIDScreen(); | 774 ShowWrongHWIDScreen(); |
| 767 } else if (screen_name == kLocallyManagedUserCreationScreenName) { | 775 } else if (screen_name == kLocallyManagedUserCreationScreenName) { |
| 768 ShowLocallyManagedUserCreationScreen(); | 776 ShowLocallyManagedUserCreationScreen(); |
| 769 } else if (screen_name == kAppLaunchSplashScreenName) { | 777 } else if (screen_name == kAppLaunchSplashScreenName) { |
| 770 AutoLaunchKioskApp(); | 778 AutoLaunchKioskApp(); |
| 771 } else if (screen_name == kHIDDetectionScreenName) { | 779 } else if (screen_name == kHIDDetectionScreenName) { |
| 772 ShowHIDDetectionScreen(); | 780 ShowHIDDetectionScreen(); |
| 773 } else if (screen_name != kTestNoScreenName) { | 781 } else if (screen_name != kTestNoScreenName) { |
| 774 if (is_out_of_box_) { | 782 if (is_out_of_box_) { |
| 775 ShowNetworkScreen(); | 783 if (CanShowHIDDetectionScreen()) { |
| 784 ShowHIDDetectionScreen(); | |
| 785 } else { | |
| 786 ShowNetworkScreen(); | |
| 787 } | |
| 776 } else { | 788 } else { |
| 777 ShowLoginScreen(LoginScreenContext()); | 789 ShowLoginScreen(LoginScreenContext()); |
| 778 } | 790 } |
| 779 } | 791 } |
| 780 } | 792 } |
| 781 | 793 |
| 782 /////////////////////////////////////////////////////////////////////////////// | 794 /////////////////////////////////////////////////////////////////////////////// |
| 783 // WizardController, chromeos::ScreenObserver overrides: | 795 // WizardController, chromeos::ScreenObserver overrides: |
| 784 void WizardController::OnExit(ExitCodes exit_code) { | 796 void WizardController::OnExit(ExitCodes exit_code) { |
| 785 VLOG(1) << "Wizard screen exit code: " << exit_code; | 797 VLOG(1) << "Wizard screen exit code: " << exit_code; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1038 // cancelled on destruction. | 1050 // cancelled on destruction. |
| 1039 GetTimezoneProvider()->RequestTimezone( | 1051 GetTimezoneProvider()->RequestTimezone( |
| 1040 position, | 1052 position, |
| 1041 false, // sensor | 1053 false, // sensor |
| 1042 timeout - elapsed, | 1054 timeout - elapsed, |
| 1043 base::Bind(&WizardController::OnTimezoneResolved, | 1055 base::Bind(&WizardController::OnTimezoneResolved, |
| 1044 base::Unretained(this))); | 1056 base::Unretained(this))); |
| 1045 } | 1057 } |
| 1046 | 1058 |
| 1047 } // namespace chromeos | 1059 } // namespace chromeos |
| OLD | NEW |