| 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/common/wallpaper/wallpaper_controller.h" | 10 #include "ash/common/wallpaper/wallpaper_controller.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 // URL which corresponds to the OOBE WebUI. | 120 // URL which corresponds to the OOBE WebUI. |
| 121 const char kOobeURL[] = "chrome://oobe/oobe"; | 121 const char kOobeURL[] = "chrome://oobe/oobe"; |
| 122 | 122 |
| 123 // URL which corresponds to the user adding WebUI. | 123 // URL which corresponds to the user adding WebUI. |
| 124 const char kUserAddingURL[] = "chrome://oobe/user-adding"; | 124 const char kUserAddingURL[] = "chrome://oobe/user-adding"; |
| 125 | 125 |
| 126 // URL which corresponds to the app launch splash WebUI. | 126 // URL which corresponds to the app launch splash WebUI. |
| 127 const char kAppLaunchSplashURL[] = "chrome://oobe/app-launch-splash"; | 127 const char kAppLaunchSplashURL[] = "chrome://oobe/app-launch-splash"; |
| 128 | 128 |
| 129 // URL which corresponds to the ARC kiosk splash WebUI. |
| 130 const char kArcKioskSplashURL[] = "chrome://oobe/arc-kiosk-splash"; |
| 131 |
| 129 // Duration of sign-in transition animation. | 132 // Duration of sign-in transition animation. |
| 130 const int kLoginFadeoutTransitionDurationMs = 700; | 133 const int kLoginFadeoutTransitionDurationMs = 700; |
| 131 | 134 |
| 132 // Number of times we try to reload OOBE/login WebUI if it crashes. | 135 // Number of times we try to reload OOBE/login WebUI if it crashes. |
| 133 const int kCrashCountLimit = 5; | 136 const int kCrashCountLimit = 5; |
| 134 | 137 |
| 135 // The default fade out animation time in ms. | 138 // The default fade out animation time in ms. |
| 136 const int kDefaultFadeTimeMs = 200; | 139 const int kDefaultFadeTimeMs = 200; |
| 137 | 140 |
| 138 // Whether to enable tnitializing WebUI in hidden state (see | 141 // Whether to enable tnitializing WebUI in hidden state (see |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 LoadURL(GURL(kAppLaunchSplashURL)); | 780 LoadURL(GURL(kAppLaunchSplashURL)); |
| 778 | 781 |
| 779 login_view_->set_should_emit_login_prompt_visible(false); | 782 login_view_->set_should_emit_login_prompt_visible(false); |
| 780 | 783 |
| 781 app_launch_controller_.reset(new AppLaunchController( | 784 app_launch_controller_.reset(new AppLaunchController( |
| 782 app_id, diagnostic_mode, this, GetOobeUI())); | 785 app_id, diagnostic_mode, this, GetOobeUI())); |
| 783 | 786 |
| 784 app_launch_controller_->StartAppLaunch(auto_launch); | 787 app_launch_controller_->StartAppLaunch(auto_launch); |
| 785 } | 788 } |
| 786 | 789 |
| 790 void LoginDisplayHostImpl::StartArcKiosk(const AccountId& account_id) { |
| 791 VLOG(1) << "Login WebUI >> start ARC kiosk."; |
| 792 SetStatusAreaVisible(false); |
| 793 |
| 794 // Animation is not supported in Mash. |
| 795 if (!chrome::IsRunningInMash()) |
| 796 finalize_animation_type_ = ANIMATION_FADE_OUT; |
| 797 if (!login_window_) { |
| 798 LoadURL(GURL(kAppLaunchSplashURL)); |
| 799 LoadURL(GURL(kArcKioskSplashURL)); |
| 800 } |
| 801 |
| 802 login_view_->set_should_emit_login_prompt_visible(false); |
| 803 |
| 804 arc_kiosk_controller_.reset(new ArcKioskController(this, GetOobeUI())); |
| 805 |
| 806 arc_kiosk_controller_->StartArcKiosk(account_id); |
| 807 } |
| 808 |
| 787 //////////////////////////////////////////////////////////////////////////////// | 809 //////////////////////////////////////////////////////////////////////////////// |
| 788 // LoginDisplayHostImpl, public | 810 // LoginDisplayHostImpl, public |
| 789 | 811 |
| 790 WizardController* LoginDisplayHostImpl::CreateWizardController() { | 812 WizardController* LoginDisplayHostImpl::CreateWizardController() { |
| 791 // TODO(altimofeev): ensure that WebUI is ready. | 813 // TODO(altimofeev): ensure that WebUI is ready. |
| 792 OobeUI* oobe_ui = GetOobeUI(); | 814 OobeUI* oobe_ui = GetOobeUI(); |
| 793 return new WizardController(this, oobe_ui); | 815 return new WizardController(this, oobe_ui); |
| 794 } | 816 } |
| 795 | 817 |
| 796 void LoginDisplayHostImpl::OnBrowserCreated() { | 818 void LoginDisplayHostImpl::OnBrowserCreated() { |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1369 | 1391 |
| 1370 locale_util::SwitchLanguageCallback callback( | 1392 locale_util::SwitchLanguageCallback callback( |
| 1371 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); | 1393 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); |
| 1372 | 1394 |
| 1373 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1395 // Load locale keyboards here. Hardware layout would be automatically enabled. |
| 1374 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, | 1396 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, |
| 1375 callback, ProfileManager::GetActiveUserProfile()); | 1397 callback, ProfileManager::GetActiveUserProfile()); |
| 1376 } | 1398 } |
| 1377 | 1399 |
| 1378 } // namespace chromeos | 1400 } // namespace chromeos |
| OLD | NEW |