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