| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "chrome/browser/chromeos/login/screens/network_screen.h" | 42 #include "chrome/browser/chromeos/login/screens/network_screen.h" |
| 43 #include "chrome/browser/chromeos/login/screens/reset_screen.h" | 43 #include "chrome/browser/chromeos/login/screens/reset_screen.h" |
| 44 #include "chrome/browser/chromeos/login/screens/terms_of_service_screen.h" | 44 #include "chrome/browser/chromeos/login/screens/terms_of_service_screen.h" |
| 45 #include "chrome/browser/chromeos/login/screens/update_screen.h" | 45 #include "chrome/browser/chromeos/login/screens/update_screen.h" |
| 46 #include "chrome/browser/chromeos/login/screens/user_image_screen.h" | 46 #include "chrome/browser/chromeos/login/screens/user_image_screen.h" |
| 47 #include "chrome/browser/chromeos/login/screens/wrong_hwid_screen.h" | 47 #include "chrome/browser/chromeos/login/screens/wrong_hwid_screen.h" |
| 48 #include "chrome/browser/chromeos/login/startup_utils.h" | 48 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 49 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_scre
en.h" | 49 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_scre
en.h" |
| 50 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 50 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 51 #include "chrome/browser/chromeos/login/ui/oobe_display.h" | 51 #include "chrome/browser/chromeos/login/ui/oobe_display.h" |
| 52 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
| 53 #include "chrome/browser/chromeos/net/delay_network_call.h" | 52 #include "chrome/browser/chromeos/net/delay_network_call.h" |
| 54 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 53 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 55 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" | 54 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" |
| 56 #include "chrome/browser/chromeos/settings/cros_settings.h" | 55 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 57 #include "chrome/browser/chromeos/timezone/timezone_provider.h" | 56 #include "chrome/browser/chromeos/timezone/timezone_provider.h" |
| 58 #include "chrome/browser/lifetime/application_lifetime.h" | 57 #include "chrome/browser/lifetime/application_lifetime.h" |
| 59 #include "chrome/browser/metrics/metrics_reporting_state.h" | 58 #include "chrome/browser/metrics/metrics_reporting_state.h" |
| 60 #include "chrome/browser/profiles/profile.h" | 59 #include "chrome/browser/profiles/profile.h" |
| 61 #include "chrome/browser/profiles/profile_manager.h" | 60 #include "chrome/browser/profiles/profile_manager.h" |
| 62 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | 61 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
| 63 #include "chrome/common/chrome_constants.h" | 62 #include "chrome/common/chrome_constants.h" |
| 64 #include "chrome/common/pref_names.h" | 63 #include "chrome/common/pref_names.h" |
| 65 #include "chromeos/audio/cras_audio_handler.h" | 64 #include "chromeos/audio/cras_audio_handler.h" |
| 66 #include "chromeos/chromeos_constants.h" | 65 #include "chromeos/chromeos_constants.h" |
| 67 #include "chromeos/chromeos_switches.h" | 66 #include "chromeos/chromeos_switches.h" |
| 68 #include "chromeos/dbus/dbus_thread_manager.h" | 67 #include "chromeos/dbus/dbus_thread_manager.h" |
| 69 #include "chromeos/dbus/session_manager_client.h" | 68 #include "chromeos/dbus/session_manager_client.h" |
| 70 #include "chromeos/network/network_state.h" | 69 #include "chromeos/network/network_state.h" |
| 71 #include "chromeos/network/network_state_handler.h" | 70 #include "chromeos/network/network_state_handler.h" |
| 72 #include "chromeos/network/portal_detector/network_portal_detector.h" | 71 #include "chromeos/network/portal_detector/network_portal_detector.h" |
| 73 #include "chromeos/settings/cros_settings_names.h" | 72 #include "chromeos/settings/cros_settings_names.h" |
| 74 #include "chromeos/settings/timezone_settings.h" | 73 #include "chromeos/settings/timezone_settings.h" |
| 75 #include "components/breakpad/app/breakpad_linux.h" | 74 #include "components/breakpad/app/breakpad_linux.h" |
| 75 #include "components/user_manager/user_manager.h" |
| 76 #include "content/public/browser/browser_thread.h" | 76 #include "content/public/browser/browser_thread.h" |
| 77 #include "content/public/browser/notification_types.h" | 77 #include "content/public/browser/notification_types.h" |
| 78 #include "ui/base/accelerators/accelerator.h" | 78 #include "ui/base/accelerators/accelerator.h" |
| 79 | 79 |
| 80 using content::BrowserThread; | 80 using content::BrowserThread; |
| 81 | 81 |
| 82 namespace { | 82 namespace { |
| 83 // If reboot didn't happen, ask user to reboot device manually. | 83 // If reboot didn't happen, ask user to reboot device manually. |
| 84 const int kWaitForRebootTimeSec = 3; | 84 const int kWaitForRebootTimeSec = 3; |
| 85 | 85 |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 oobe_display_ = NULL; | 437 oobe_display_ = NULL; |
| 438 } | 438 } |
| 439 | 439 |
| 440 void WizardController::ShowUpdateScreen() { | 440 void WizardController::ShowUpdateScreen() { |
| 441 VLOG(1) << "Showing update screen."; | 441 VLOG(1) << "Showing update screen."; |
| 442 SetStatusAreaVisible(true); | 442 SetStatusAreaVisible(true); |
| 443 SetCurrentScreen(GetUpdateScreen()); | 443 SetCurrentScreen(GetUpdateScreen()); |
| 444 } | 444 } |
| 445 | 445 |
| 446 void WizardController::ShowUserImageScreen() { | 446 void WizardController::ShowUserImageScreen() { |
| 447 const chromeos::UserManager* user_manager = chromeos::UserManager::Get(); | 447 const user_manager::UserManager* user_manager = |
| 448 user_manager::UserManager::Get(); |
| 448 // Skip user image selection for public sessions and ephemeral logins. | 449 // Skip user image selection for public sessions and ephemeral logins. |
| 449 if (user_manager->IsLoggedInAsPublicAccount() || | 450 if (user_manager->IsLoggedInAsPublicAccount() || |
| 450 user_manager->IsCurrentUserNonCryptohomeDataEphemeral()) { | 451 user_manager->IsCurrentUserNonCryptohomeDataEphemeral()) { |
| 451 OnUserImageSkipped(); | 452 OnUserImageSkipped(); |
| 452 return; | 453 return; |
| 453 } | 454 } |
| 454 VLOG(1) << "Showing user image screen."; | 455 VLOG(1) << "Showing user image screen."; |
| 455 | 456 |
| 456 bool profile_picture_enabled = true; | 457 bool profile_picture_enabled = true; |
| 457 std::string user_id; | 458 std::string user_id; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 void WizardController::ShowKioskAutolaunchScreen() { | 525 void WizardController::ShowKioskAutolaunchScreen() { |
| 525 VLOG(1) << "Showing kiosk autolaunch screen."; | 526 VLOG(1) << "Showing kiosk autolaunch screen."; |
| 526 SetStatusAreaVisible(false); | 527 SetStatusAreaVisible(false); |
| 527 SetCurrentScreen(GetKioskAutolaunchScreen()); | 528 SetCurrentScreen(GetKioskAutolaunchScreen()); |
| 528 } | 529 } |
| 529 | 530 |
| 530 void WizardController::ShowTermsOfServiceScreen() { | 531 void WizardController::ShowTermsOfServiceScreen() { |
| 531 // Only show the Terms of Service when logging into a public account and Terms | 532 // Only show the Terms of Service when logging into a public account and Terms |
| 532 // of Service have been specified through policy. In all other cases, advance | 533 // of Service have been specified through policy. In all other cases, advance |
| 533 // to the user image screen immediately. | 534 // to the user image screen immediately. |
| 534 if (!chromeos::UserManager::Get()->IsLoggedInAsPublicAccount() || | 535 if (!user_manager::UserManager::Get()->IsLoggedInAsPublicAccount() || |
| 535 !ProfileManager::GetActiveUserProfile()->GetPrefs()-> | 536 !ProfileManager::GetActiveUserProfile()->GetPrefs()->IsManagedPreference( |
| 536 IsManagedPreference(prefs::kTermsOfServiceURL)) { | 537 prefs::kTermsOfServiceURL)) { |
| 537 ShowUserImageScreen(); | 538 ShowUserImageScreen(); |
| 538 return; | 539 return; |
| 539 } | 540 } |
| 540 | 541 |
| 541 VLOG(1) << "Showing Terms of Service screen."; | 542 VLOG(1) << "Showing Terms of Service screen."; |
| 542 SetStatusAreaVisible(true); | 543 SetStatusAreaVisible(true); |
| 543 SetCurrentScreen(GetTermsOfServiceScreen()); | 544 SetCurrentScreen(GetTermsOfServiceScreen()); |
| 544 } | 545 } |
| 545 | 546 |
| 546 void WizardController::ShowWrongHWIDScreen() { | 547 void WizardController::ShowWrongHWIDScreen() { |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 bool WizardController::SetOnTimeZoneResolvedForTesting( | 1289 bool WizardController::SetOnTimeZoneResolvedForTesting( |
| 1289 const base::Closure& callback) { | 1290 const base::Closure& callback) { |
| 1290 if (timezone_resolved_) | 1291 if (timezone_resolved_) |
| 1291 return false; | 1292 return false; |
| 1292 | 1293 |
| 1293 on_timezone_resolved_for_testing_ = callback; | 1294 on_timezone_resolved_for_testing_ = callback; |
| 1294 return true; | 1295 return true; |
| 1295 } | 1296 } |
| 1296 | 1297 |
| 1297 } // namespace chromeos | 1298 } // namespace chromeos |
| OLD | NEW |