| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/login_display_host_impl.h" | 5 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/audio/sounds.h" | 10 #include "ash/audio/sounds.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "chrome/browser/chromeos/login/wizard_controller.h" | 48 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 49 #include "chrome/browser/chromeos/mobile_config.h" | 49 #include "chrome/browser/chromeos/mobile_config.h" |
| 50 #include "chrome/browser/chromeos/net/delay_network_call.h" | 50 #include "chrome/browser/chromeos/net/delay_network_call.h" |
| 51 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 51 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 52 #include "chrome/browser/chromeos/policy/enrollment_config.h" | 52 #include "chrome/browser/chromeos/policy/enrollment_config.h" |
| 53 #include "chrome/browser/chromeos/settings/cros_settings.h" | 53 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 54 #include "chrome/browser/chromeos/system/device_disabling_manager.h" | 54 #include "chrome/browser/chromeos/system/device_disabling_manager.h" |
| 55 #include "chrome/browser/chromeos/system/input_device_settings.h" | 55 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| 56 #include "chrome/browser/chromeos/system/timezone_util.h" | 56 #include "chrome/browser/chromeos/system/timezone_util.h" |
| 57 #include "chrome/browser/chromeos/ui/focus_ring_controller.h" | 57 #include "chrome/browser/chromeos/ui/focus_ring_controller.h" |
| 58 #include "chrome/browser/lifetime/application_lifetime.h" | 58 #include "chrome/browser/lifetime/keep_alive_types.h" |
| 59 #include "chrome/browser/lifetime/scoped_keep_alive.h" |
| 59 #include "chrome/browser/profiles/profile_manager.h" | 60 #include "chrome/browser/profiles/profile_manager.h" |
| 60 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" | 61 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" |
| 61 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 62 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 62 #include "chrome/common/chrome_constants.h" | 63 #include "chrome/common/chrome_constants.h" |
| 63 #include "chrome/common/chrome_switches.h" | 64 #include "chrome/common/chrome_switches.h" |
| 64 #include "chrome/common/pref_names.h" | 65 #include "chrome/common/pref_names.h" |
| 65 #include "chrome/grit/browser_resources.h" | 66 #include "chrome/grit/browser_resources.h" |
| 66 #include "chromeos/audio/chromeos_sounds.h" | 67 #include "chromeos/audio/chromeos_sounds.h" |
| 67 #include "chromeos/chromeos_constants.h" | 68 #include "chromeos/chromeos_constants.h" |
| 68 #include "chromeos/chromeos_switches.h" | 69 #include "chromeos/chromeos_switches.h" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 | 307 |
| 307 // Login screen is moved to lock screen container when user logs in. | 308 // Login screen is moved to lock screen container when user logs in. |
| 308 registrar_.Add(this, | 309 registrar_.Add(this, |
| 309 chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 310 chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
| 310 content::NotificationService::AllSources()); | 311 content::NotificationService::AllSources()); |
| 311 | 312 |
| 312 DCHECK(default_host() == nullptr); | 313 DCHECK(default_host() == nullptr); |
| 313 default_host_ = this; | 314 default_host_ = this; |
| 314 | 315 |
| 315 // Make sure chrome won't exit while we are at login/oobe screen. | 316 // Make sure chrome won't exit while we are at login/oobe screen. |
| 316 chrome::IncrementKeepAliveCount(); | 317 // Is released when we get out of scope. |
| 318 ScopedKeepAlive keep_alive(KeepAliveOrigin::LOGIN_DISPLAY_HOST_IMPL, |
| 319 KeepAliveRestartOption::DISABLED); |
| 317 | 320 |
| 318 bool is_registered = StartupUtils::IsDeviceRegistered(); | 321 bool is_registered = StartupUtils::IsDeviceRegistered(); |
| 319 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); | 322 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); |
| 320 bool disable_boot_animation = | 323 bool disable_boot_animation = |
| 321 base::CommandLine::ForCurrentProcess()->HasSwitch( | 324 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 322 switches::kDisableBootAnimation); | 325 switches::kDisableBootAnimation); |
| 323 | 326 |
| 324 waiting_for_wallpaper_load_ = !zero_delay_enabled && | 327 waiting_for_wallpaper_load_ = !zero_delay_enabled && |
| 325 (!is_registered || !disable_boot_animation); | 328 (!is_registered || !disable_boot_animation); |
| 326 | 329 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 gfx::Screen::GetScreen()->RemoveObserver(this); | 398 gfx::Screen::GetScreen()->RemoveObserver(this); |
| 396 | 399 |
| 397 if (login_view_ && login_window_) | 400 if (login_view_ && login_window_) |
| 398 login_window_->RemoveRemovalsObserver(this); | 401 login_window_->RemoveRemovalsObserver(this); |
| 399 | 402 |
| 400 ResetKeyboardOverscrollOverride(); | 403 ResetKeyboardOverscrollOverride(); |
| 401 | 404 |
| 402 views::FocusManager::set_arrow_key_traversal_enabled(false); | 405 views::FocusManager::set_arrow_key_traversal_enabled(false); |
| 403 ResetLoginWindowAndView(); | 406 ResetLoginWindowAndView(); |
| 404 | 407 |
| 405 // Let chrome process exit after login/oobe screen if needed. | |
| 406 chrome::DecrementKeepAliveCount(); | |
| 407 | |
| 408 default_host_ = nullptr; | 408 default_host_ = nullptr; |
| 409 // TODO(tengs): This should be refactored. See crbug.com/314934. | 409 // TODO(tengs): This should be refactored. See crbug.com/314934. |
| 410 if (user_manager::UserManager::Get()->IsCurrentUserNew()) { | 410 if (user_manager::UserManager::Get()->IsCurrentUserNew()) { |
| 411 // DriveOptInController will delete itself when finished. | 411 // DriveOptInController will delete itself when finished. |
| 412 (new DriveFirstRunController( | 412 (new DriveFirstRunController( |
| 413 ProfileManager::GetActiveUserProfile()))->EnableOfflineMode(); | 413 ProfileManager::GetActiveUserProfile()))->EnableOfflineMode(); |
| 414 } | 414 } |
| 415 } | 415 } |
| 416 | 416 |
| 417 //////////////////////////////////////////////////////////////////////////////// | 417 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1286 | 1286 |
| 1287 locale_util::SwitchLanguageCallback callback( | 1287 locale_util::SwitchLanguageCallback callback( |
| 1288 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); | 1288 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); |
| 1289 | 1289 |
| 1290 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1290 // Load locale keyboards here. Hardware layout would be automatically enabled. |
| 1291 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, | 1291 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, |
| 1292 callback, ProfileManager::GetActiveUserProfile()); | 1292 callback, ProfileManager::GetActiveUserProfile()); |
| 1293 } | 1293 } |
| 1294 | 1294 |
| 1295 } // namespace chromeos | 1295 } // namespace chromeos |
| OLD | NEW |