| 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 "base/values.h" | 18 #include "base/values.h" |
| 19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/browser/browser_shutdown.h" | 20 #include "chrome/browser/browser_shutdown.h" |
| 21 #include "chrome/browser/chrome_notification_types.h" | 21 #include "chrome/browser/chrome_notification_types.h" |
| 22 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 22 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 23 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 23 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 24 #include "chrome/browser/chromeos/base/locale_util.h" | 24 #include "chrome/browser/chromeos/base/locale_util.h" |
| 25 #include "chrome/browser/chromeos/boot_times_loader.h" | 25 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 26 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h" | 26 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h" |
| 27 #include "chrome/browser/chromeos/first_run/first_run.h" | 27 #include "chrome/browser/chromeos/first_run/first_run.h" |
| 28 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 28 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 29 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | |
| 30 #include "chrome/browser/chromeos/language_preferences.h" | 29 #include "chrome/browser/chromeos/language_preferences.h" |
| 31 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | 30 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.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" |
| 39 #include "chrome/browser/chromeos/login/ui/oobe_display.h" | 38 #include "chrome/browser/chromeos/login/ui/oobe_display.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 initialize_webui_hidden_ = true; | 356 initialize_webui_hidden_ = true; |
| 358 else if (override_type == kWebUIInitPostpone) | 357 else if (override_type == kWebUIInitPostpone) |
| 359 initialize_webui_hidden_ = false; | 358 initialize_webui_hidden_ = false; |
| 360 } | 359 } |
| 361 | 360 |
| 362 // Always postpone WebUI initialization on first boot, otherwise we miss | 361 // Always postpone WebUI initialization on first boot, otherwise we miss |
| 363 // initial animation. | 362 // initial animation. |
| 364 if (!StartupUtils::IsOobeCompleted()) | 363 if (!StartupUtils::IsOobeCompleted()) |
| 365 initialize_webui_hidden_ = false; | 364 initialize_webui_hidden_ = false; |
| 366 | 365 |
| 367 // There is no wallpaper for KioskMode, don't initialize the webui hidden. | |
| 368 if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) | |
| 369 initialize_webui_hidden_ = false; | |
| 370 | |
| 371 #if !defined(USE_ATHENA) | 366 #if !defined(USE_ATHENA) |
| 372 if (waiting_for_wallpaper_load_) { | 367 if (waiting_for_wallpaper_load_) { |
| 373 registrar_.Add(this, | 368 registrar_.Add(this, |
| 374 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, | 369 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, |
| 375 content::NotificationService::AllSources()); | 370 content::NotificationService::AllSources()); |
| 376 } | 371 } |
| 377 #endif | 372 #endif |
| 378 | 373 |
| 379 // When we wait for WebUI to be initialized we wait for one of | 374 // When we wait for WebUI to be initialized we wait for one of |
| 380 // these notifications. | 375 // these notifications. |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 // Initiate device policy fetching. | 671 // Initiate device policy fetching. |
| 677 policy::BrowserPolicyConnectorChromeOS* connector = | 672 policy::BrowserPolicyConnectorChromeOS* connector = |
| 678 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 673 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 679 connector->ScheduleServiceInitialization( | 674 connector->ScheduleServiceInitialization( |
| 680 kPolicyServiceInitializationDelayMilliseconds); | 675 kPolicyServiceInitializationDelayMilliseconds); |
| 681 | 676 |
| 682 CHECK(webui_login_display_); | 677 CHECK(webui_login_display_); |
| 683 GetOobeUI()->ShowSigninScreen(context, | 678 GetOobeUI()->ShowSigninScreen(context, |
| 684 webui_login_display_, | 679 webui_login_display_, |
| 685 webui_login_display_); | 680 webui_login_display_); |
| 686 if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) | |
| 687 SetStatusAreaVisible(false); | |
| 688 TRACE_EVENT_ASYNC_STEP_INTO0("ui", | 681 TRACE_EVENT_ASYNC_STEP_INTO0("ui", |
| 689 "ShowLoginWebUI", | 682 "ShowLoginWebUI", |
| 690 kShowLoginWebUIid, | 683 kShowLoginWebUIid, |
| 691 "WaitForScreenStateInitialize"); | 684 "WaitForScreenStateInitialize"); |
| 692 BootTimesLoader::Get()->RecordCurrentStats( | 685 BootTimesLoader::Get()->RecordCurrentStats( |
| 693 "login-wait-for-signin-state-initialize"); | 686 "login-wait-for-signin-state-initialize"); |
| 694 } | 687 } |
| 695 | 688 |
| 696 void LoginDisplayHostImpl::ResumeSignInScreen() { | 689 void LoginDisplayHostImpl::ResumeSignInScreen() { |
| 697 // We only get here after a previous call the StartSignInScreen. That sign-in | 690 // We only get here after a previous call the StartSignInScreen. That sign-in |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 | 1309 |
| 1317 locale_util::SwitchLanguageCallback callback( | 1310 locale_util::SwitchLanguageCallback callback( |
| 1318 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))); | 1311 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))); |
| 1319 | 1312 |
| 1320 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1313 // Load locale keyboards here. Hardware layout would be automatically enabled. |
| 1321 locale_util::SwitchLanguage( | 1314 locale_util::SwitchLanguage( |
| 1322 locale, true, true /* login_layouts_only */, callback); | 1315 locale, true, true /* login_layouts_only */, callback); |
| 1323 } | 1316 } |
| 1324 | 1317 |
| 1325 } // namespace chromeos | 1318 } // namespace chromeos |
| OLD | NEW |