| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
| 14 #include "base/strings/string_split.h" | 14 #include "base/strings/string_split.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/threading/thread_restrictions.h" | 16 #include "base/threading/thread_restrictions.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/browser_shutdown.h" | 19 #include "chrome/browser/browser_shutdown.h" |
| 20 #include "chrome/browser/chrome_notification_types.h" | 20 #include "chrome/browser/chrome_notification_types.h" |
| 21 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 21 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 22 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 22 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 23 #include "chrome/browser/chromeos/base/locale_util.h" | 23 #include "chrome/browser/chromeos/base/locale_util.h" |
| 24 #include "chrome/browser/chromeos/boot_times_loader.h" | 24 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 25 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h" | 25 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h" |
| 26 #include "chrome/browser/chromeos/first_run/first_run.h" | 26 #include "chrome/browser/chromeos/first_run/first_run.h" |
| 27 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 27 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 28 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | |
| 29 #include "chrome/browser/chromeos/language_preferences.h" | 28 #include "chrome/browser/chromeos/language_preferences.h" |
| 30 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | 29 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" |
| 31 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" | 30 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" |
| 32 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 31 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 33 #include "chrome/browser/chromeos/login/helper.h" | 32 #include "chrome/browser/chromeos/login/helper.h" |
| 34 #include "chrome/browser/chromeos/login/login_utils.h" | 33 #include "chrome/browser/chromeos/login/login_utils.h" |
| 35 #include "chrome/browser/chromeos/login/login_wizard.h" | 34 #include "chrome/browser/chromeos/login/login_wizard.h" |
| 36 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" | 35 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" |
| 37 #include "chrome/browser/chromeos/login/startup_utils.h" | 36 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 38 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" | 37 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 initialize_webui_hidden_ = true; | 358 initialize_webui_hidden_ = true; |
| 360 else if (override_type == kWebUIInitPostpone) | 359 else if (override_type == kWebUIInitPostpone) |
| 361 initialize_webui_hidden_ = false; | 360 initialize_webui_hidden_ = false; |
| 362 } | 361 } |
| 363 | 362 |
| 364 // Always postpone WebUI initialization on first boot, otherwise we miss | 363 // Always postpone WebUI initialization on first boot, otherwise we miss |
| 365 // initial animation. | 364 // initial animation. |
| 366 if (!StartupUtils::IsOobeCompleted()) | 365 if (!StartupUtils::IsOobeCompleted()) |
| 367 initialize_webui_hidden_ = false; | 366 initialize_webui_hidden_ = false; |
| 368 | 367 |
| 369 // There is no wallpaper for KioskMode, don't initialize the webui hidden. | |
| 370 if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) | |
| 371 initialize_webui_hidden_ = false; | |
| 372 | |
| 373 #if !defined(USE_ATHENA) | 368 #if !defined(USE_ATHENA) |
| 374 if (waiting_for_wallpaper_load_) { | 369 if (waiting_for_wallpaper_load_) { |
| 375 registrar_.Add(this, | 370 registrar_.Add(this, |
| 376 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, | 371 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, |
| 377 content::NotificationService::AllSources()); | 372 content::NotificationService::AllSources()); |
| 378 } | 373 } |
| 379 #endif | 374 #endif |
| 380 | 375 |
| 381 // When we wait for WebUI to be initialized we wait for one of | 376 // When we wait for WebUI to be initialized we wait for one of |
| 382 // these notifications. | 377 // these notifications. |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 // Initiate device policy fetching. | 661 // Initiate device policy fetching. |
| 667 policy::BrowserPolicyConnectorChromeOS* connector = | 662 policy::BrowserPolicyConnectorChromeOS* connector = |
| 668 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 663 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 669 connector->ScheduleServiceInitialization( | 664 connector->ScheduleServiceInitialization( |
| 670 kPolicyServiceInitializationDelayMilliseconds); | 665 kPolicyServiceInitializationDelayMilliseconds); |
| 671 | 666 |
| 672 CHECK(webui_login_display_); | 667 CHECK(webui_login_display_); |
| 673 GetOobeUI()->ShowSigninScreen(context, | 668 GetOobeUI()->ShowSigninScreen(context, |
| 674 webui_login_display_, | 669 webui_login_display_, |
| 675 webui_login_display_); | 670 webui_login_display_); |
| 676 if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) | |
| 677 SetStatusAreaVisible(false); | |
| 678 TRACE_EVENT_ASYNC_STEP_INTO0("ui", | 671 TRACE_EVENT_ASYNC_STEP_INTO0("ui", |
| 679 "ShowLoginWebUI", | 672 "ShowLoginWebUI", |
| 680 kShowLoginWebUIid, | 673 kShowLoginWebUIid, |
| 681 "WaitForScreenStateInitialize"); | 674 "WaitForScreenStateInitialize"); |
| 682 BootTimesLoader::Get()->RecordCurrentStats( | 675 BootTimesLoader::Get()->RecordCurrentStats( |
| 683 "login-wait-for-signin-state-initialize"); | 676 "login-wait-for-signin-state-initialize"); |
| 684 } | 677 } |
| 685 | 678 |
| 686 void LoginDisplayHostImpl::OnPreferencesChanged() { | 679 void LoginDisplayHostImpl::OnPreferencesChanged() { |
| 687 if (is_showing_login_) | 680 if (is_showing_login_) |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1280 | 1273 |
| 1281 locale_util::SwitchLanguageCallback callback( | 1274 locale_util::SwitchLanguageCallback callback( |
| 1282 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))); | 1275 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))); |
| 1283 | 1276 |
| 1284 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1277 // Load locale keyboards here. Hardware layout would be automatically enabled. |
| 1285 locale_util::SwitchLanguage( | 1278 locale_util::SwitchLanguage( |
| 1286 locale, true, true /* login_layouts_only */, callback); | 1279 locale, true, true /* login_layouts_only */, callback); |
| 1287 } | 1280 } |
| 1288 | 1281 |
| 1289 } // namespace chromeos | 1282 } // namespace chromeos |
| OLD | NEW |