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 "ash/audio/sounds.h" | 9 #include "ash/audio/sounds.h" |
10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 | 661 |
662 void LoginDisplayHostImpl::StartDemoAppLaunch() { | 662 void LoginDisplayHostImpl::StartDemoAppLaunch() { |
663 VLOG(1) << "Login WebUI >> starting demo app."; | 663 VLOG(1) << "Login WebUI >> starting demo app."; |
664 SetStatusAreaVisible(false); | 664 SetStatusAreaVisible(false); |
665 | 665 |
666 demo_app_launcher_.reset(new DemoAppLauncher()); | 666 demo_app_launcher_.reset(new DemoAppLauncher()); |
667 demo_app_launcher_->StartDemoAppLaunch(); | 667 demo_app_launcher_->StartDemoAppLaunch(); |
668 } | 668 } |
669 | 669 |
670 void LoginDisplayHostImpl::StartAppLaunch(const std::string& app_id, | 670 void LoginDisplayHostImpl::StartAppLaunch(const std::string& app_id, |
671 bool diagnostic_mode) { | 671 bool diagnostic_mode, |
| 672 bool auto_launch) { |
672 VLOG(1) << "Login WebUI >> start app launch."; | 673 VLOG(1) << "Login WebUI >> start app launch."; |
673 SetStatusAreaVisible(false); | 674 SetStatusAreaVisible(false); |
674 | 675 |
675 // Wait for the |CrosSettings| to become either trusted or permanently | 676 // Wait for the |CrosSettings| to become either trusted or permanently |
676 // untrusted. | 677 // untrusted. |
677 const CrosSettingsProvider::TrustedStatus status = | 678 const CrosSettingsProvider::TrustedStatus status = |
678 CrosSettings::Get()->PrepareTrustedValues(base::Bind( | 679 CrosSettings::Get()->PrepareTrustedValues(base::Bind( |
679 &LoginDisplayHostImpl::StartAppLaunch, | 680 &LoginDisplayHostImpl::StartAppLaunch, |
680 pointer_factory_.GetWeakPtr(), | 681 pointer_factory_.GetWeakPtr(), |
681 app_id, | 682 app_id, |
682 diagnostic_mode)); | 683 diagnostic_mode, |
| 684 auto_launch)); |
683 if (status == CrosSettingsProvider::TEMPORARILY_UNTRUSTED) | 685 if (status == CrosSettingsProvider::TEMPORARILY_UNTRUSTED) |
684 return; | 686 return; |
685 | 687 |
686 if (status == CrosSettingsProvider::PERMANENTLY_UNTRUSTED) { | 688 if (status == CrosSettingsProvider::PERMANENTLY_UNTRUSTED) { |
687 // If the |CrosSettings| are permanently untrusted, refuse to launch a | 689 // If the |CrosSettings| are permanently untrusted, refuse to launch a |
688 // single-app kiosk mode session. | 690 // single-app kiosk mode session. |
689 LOG(ERROR) << "Login WebUI >> Refusing to launch single-app kiosk mode."; | 691 LOG(ERROR) << "Login WebUI >> Refusing to launch single-app kiosk mode."; |
690 SetStatusAreaVisible(true); | 692 SetStatusAreaVisible(true); |
691 return; | 693 return; |
692 } | 694 } |
693 | 695 |
694 bool device_disabled = false; | 696 bool device_disabled = false; |
695 CrosSettings::Get()->GetBoolean(kDeviceDisabled, &device_disabled); | 697 CrosSettings::Get()->GetBoolean(kDeviceDisabled, &device_disabled); |
696 if (device_disabled && system::DeviceDisablingManager:: | 698 if (device_disabled && system::DeviceDisablingManager:: |
697 HonorDeviceDisablingDuringNormalOperation()) { | 699 HonorDeviceDisablingDuringNormalOperation()) { |
698 // If the device is disabled, bail out. A device disabled screen will be | 700 // If the device is disabled, bail out. A device disabled screen will be |
699 // shown by the DeviceDisablingManager. | 701 // shown by the DeviceDisablingManager. |
700 return; | 702 return; |
701 } | 703 } |
702 | 704 |
703 finalize_animation_type_ = ANIMATION_FADE_OUT; | 705 finalize_animation_type_ = ANIMATION_FADE_OUT; |
704 if (!login_window_) | 706 if (!login_window_) |
705 LoadURL(GURL(kAppLaunchSplashURL)); | 707 LoadURL(GURL(kAppLaunchSplashURL)); |
706 | 708 |
707 login_view_->set_should_emit_login_prompt_visible(false); | 709 login_view_->set_should_emit_login_prompt_visible(false); |
708 | 710 |
709 app_launch_controller_.reset(new AppLaunchController( | 711 app_launch_controller_.reset(new AppLaunchController( |
710 app_id, diagnostic_mode, this, GetOobeUI())); | 712 app_id, diagnostic_mode, this, GetOobeUI())); |
711 | 713 |
712 app_launch_controller_->StartAppLaunch(); | 714 app_launch_controller_->StartAppLaunch(auto_launch); |
713 } | 715 } |
714 | 716 |
715 //////////////////////////////////////////////////////////////////////////////// | 717 //////////////////////////////////////////////////////////////////////////////// |
716 // LoginDisplayHostImpl, public | 718 // LoginDisplayHostImpl, public |
717 | 719 |
718 WizardController* LoginDisplayHostImpl::CreateWizardController() { | 720 WizardController* LoginDisplayHostImpl::CreateWizardController() { |
719 // TODO(altimofeev): ensure that WebUI is ready. | 721 // TODO(altimofeev): ensure that WebUI is ready. |
720 OobeDisplay* oobe_display = GetOobeUI(); | 722 OobeDisplay* oobe_display = GetOobeUI(); |
721 return new WizardController(this, oobe_display); | 723 return new WizardController(this, oobe_display); |
722 } | 724 } |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1184 : session_manager::SESSION_STATE_OOBE); | 1186 : session_manager::SESSION_STATE_OOBE); |
1185 | 1187 |
1186 LoginDisplayHostImpl* display_host = new LoginDisplayHostImpl(screen_bounds); | 1188 LoginDisplayHostImpl* display_host = new LoginDisplayHostImpl(screen_bounds); |
1187 | 1189 |
1188 bool show_app_launch_splash_screen = | 1190 bool show_app_launch_splash_screen = |
1189 (first_screen_name == WizardController::kAppLaunchSplashScreenName); | 1191 (first_screen_name == WizardController::kAppLaunchSplashScreenName); |
1190 if (show_app_launch_splash_screen) { | 1192 if (show_app_launch_splash_screen) { |
1191 const std::string& auto_launch_app_id = | 1193 const std::string& auto_launch_app_id = |
1192 KioskAppManager::Get()->GetAutoLaunchApp(); | 1194 KioskAppManager::Get()->GetAutoLaunchApp(); |
1193 display_host->StartAppLaunch(auto_launch_app_id, | 1195 display_host->StartAppLaunch(auto_launch_app_id, |
1194 false /* diagnostic_mode */); | 1196 false /* diagnostic_mode */, |
| 1197 true /* auto_launch */); |
1195 return; | 1198 return; |
1196 } | 1199 } |
1197 | 1200 |
1198 // Check whether we need to execute OOBE flow. | 1201 // Check whether we need to execute OOBE flow. |
1199 const policy::EnrollmentConfig enrollment_config = | 1202 const policy::EnrollmentConfig enrollment_config = |
1200 g_browser_process->platform_part() | 1203 g_browser_process->platform_part() |
1201 ->browser_policy_connector_chromeos() | 1204 ->browser_policy_connector_chromeos() |
1202 ->GetPrescribedEnrollmentConfig(); | 1205 ->GetPrescribedEnrollmentConfig(); |
1203 if (enrollment_config.should_enroll() && first_screen_name.empty()) { | 1206 if (enrollment_config.should_enroll() && first_screen_name.empty()) { |
1204 // Shows networks screen instead of enrollment screen to resume the | 1207 // Shows networks screen instead of enrollment screen to resume the |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 | 1269 |
1267 locale_util::SwitchLanguageCallback callback( | 1270 locale_util::SwitchLanguageCallback callback( |
1268 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))); | 1271 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))); |
1269 | 1272 |
1270 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1273 // Load locale keyboards here. Hardware layout would be automatically enabled. |
1271 locale_util::SwitchLanguage( | 1274 locale_util::SwitchLanguage( |
1272 locale, true, true /* login_layouts_only */, callback); | 1275 locale, true, true /* login_layouts_only */, callback); |
1273 } | 1276 } |
1274 | 1277 |
1275 } // namespace chromeos | 1278 } // namespace chromeos |
OLD | NEW |