| 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 17 matching lines...) Expand all  Loading... | 
|    28 #include "chrome/browser/browser_shutdown.h" |    28 #include "chrome/browser/browser_shutdown.h" | 
|    29 #include "chrome/browser/chrome_notification_types.h" |    29 #include "chrome/browser/chrome_notification_types.h" | 
|    30 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |    30 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 
|    31 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |    31 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 
|    32 #include "chrome/browser/chromeos/base/locale_util.h" |    32 #include "chrome/browser/chromeos/base/locale_util.h" | 
|    33 #include "chrome/browser/chromeos/boot_times_recorder.h" |    33 #include "chrome/browser/chromeos/boot_times_recorder.h" | 
|    34 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h" |    34 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h" | 
|    35 #include "chrome/browser/chromeos/first_run/first_run.h" |    35 #include "chrome/browser/chromeos/first_run/first_run.h" | 
|    36 #include "chrome/browser/chromeos/input_method/input_method_util.h" |    36 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 
|    37 #include "chrome/browser/chromeos/language_preferences.h" |    37 #include "chrome/browser/chromeos/language_preferences.h" | 
 |    38 #include "chrome/browser/chromeos/login/arc_kiosk_controller.h" | 
|    38 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" |    39 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | 
|    39 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" |    40 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" | 
|    40 #include "chrome/browser/chromeos/login/existing_user_controller.h" |    41 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 
|    41 #include "chrome/browser/chromeos/login/helper.h" |    42 #include "chrome/browser/chromeos/login/helper.h" | 
|    42 #include "chrome/browser/chromeos/login/login_wizard.h" |    43 #include "chrome/browser/chromeos/login/login_wizard.h" | 
|    43 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" |    44 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" | 
|    44 #include "chrome/browser/chromeos/login/signin/token_handle_util.h" |    45 #include "chrome/browser/chromeos/login/signin/token_handle_util.h" | 
|    45 #include "chrome/browser/chromeos/login/startup_utils.h" |    46 #include "chrome/browser/chromeos/login/startup_utils.h" | 
|    46 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" |    47 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" | 
|    47 #include "chrome/browser/chromeos/login/ui/keyboard_driven_oobe_key_handler.h" |    48 #include "chrome/browser/chromeos/login/ui/keyboard_driven_oobe_key_handler.h" | 
| (...skipping 25 matching lines...) Expand all  Loading... | 
|    73 #include "chromeos/chromeos_switches.h" |    74 #include "chromeos/chromeos_switches.h" | 
|    74 #include "chromeos/dbus/dbus_thread_manager.h" |    75 #include "chromeos/dbus/dbus_thread_manager.h" | 
|    75 #include "chromeos/dbus/session_manager_client.h" |    76 #include "chromeos/dbus/session_manager_client.h" | 
|    76 #include "chromeos/login/login_state.h" |    77 #include "chromeos/login/login_state.h" | 
|    77 #include "chromeos/settings/cros_settings_names.h" |    78 #include "chromeos/settings/cros_settings_names.h" | 
|    78 #include "chromeos/settings/cros_settings_provider.h" |    79 #include "chromeos/settings/cros_settings_provider.h" | 
|    79 #include "chromeos/settings/timezone_settings.h" |    80 #include "chromeos/settings/timezone_settings.h" | 
|    80 #include "chromeos/timezone/timezone_resolver.h" |    81 #include "chromeos/timezone/timezone_resolver.h" | 
|    81 #include "components/prefs/pref_service.h" |    82 #include "components/prefs/pref_service.h" | 
|    82 #include "components/session_manager/core/session_manager.h" |    83 #include "components/session_manager/core/session_manager.h" | 
 |    84 #include "components/signin/core/account_id/account_id.h" | 
|    83 #include "components/user_manager/user.h" |    85 #include "components/user_manager/user.h" | 
|    84 #include "components/user_manager/user_manager.h" |    86 #include "components/user_manager/user_manager.h" | 
|    85 #include "content/public/browser/notification_service.h" |    87 #include "content/public/browser/notification_service.h" | 
|    86 #include "content/public/browser/notification_types.h" |    88 #include "content/public/browser/notification_types.h" | 
|    87 #include "content/public/browser/web_contents.h" |    89 #include "content/public/browser/web_contents.h" | 
|    88 #include "content/public/browser/web_ui.h" |    90 #include "content/public/browser/web_ui.h" | 
|    89 #include "media/audio/sounds/sounds_manager.h" |    91 #include "media/audio/sounds/sounds_manager.h" | 
|    90 #include "services/ui/public/cpp/property_type_converters.h" |    92 #include "services/ui/public/cpp/property_type_converters.h" | 
|    91 #include "services/ui/public/interfaces/window_manager.mojom.h" |    93 #include "services/ui/public/interfaces/window_manager.mojom.h" | 
|    92 #include "ui/aura/window.h" |    94 #include "ui/aura/window.h" | 
| (...skipping 26 matching lines...) Expand all  Loading... | 
|   119  |   121  | 
|   120 // URL which corresponds to the OOBE WebUI. |   122 // URL which corresponds to the OOBE WebUI. | 
|   121 const char kOobeURL[] = "chrome://oobe/oobe"; |   123 const char kOobeURL[] = "chrome://oobe/oobe"; | 
|   122  |   124  | 
|   123 // URL which corresponds to the user adding WebUI. |   125 // URL which corresponds to the user adding WebUI. | 
|   124 const char kUserAddingURL[] = "chrome://oobe/user-adding"; |   126 const char kUserAddingURL[] = "chrome://oobe/user-adding"; | 
|   125  |   127  | 
|   126 // URL which corresponds to the app launch splash WebUI. |   128 // URL which corresponds to the app launch splash WebUI. | 
|   127 const char kAppLaunchSplashURL[] = "chrome://oobe/app-launch-splash"; |   129 const char kAppLaunchSplashURL[] = "chrome://oobe/app-launch-splash"; | 
|   128  |   130  | 
 |   131 // URL which corresponds to the ARC kiosk splash WebUI. | 
 |   132 const char kArcKioskSplashURL[] = "chrome://oobe/arc-kiosk-splash"; | 
 |   133  | 
|   129 // Duration of sign-in transition animation. |   134 // Duration of sign-in transition animation. | 
|   130 const int kLoginFadeoutTransitionDurationMs = 700; |   135 const int kLoginFadeoutTransitionDurationMs = 700; | 
|   131  |   136  | 
|   132 // Number of times we try to reload OOBE/login WebUI if it crashes. |   137 // Number of times we try to reload OOBE/login WebUI if it crashes. | 
|   133 const int kCrashCountLimit = 5; |   138 const int kCrashCountLimit = 5; | 
|   134  |   139  | 
|   135 // The default fade out animation time in ms. |   140 // The default fade out animation time in ms. | 
|   136 const int kDefaultFadeTimeMs = 200; |   141 const int kDefaultFadeTimeMs = 200; | 
|   137  |   142  | 
|   138 // Whether to enable tnitializing WebUI in hidden state (see |   143 // 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)); |   782     LoadURL(GURL(kAppLaunchSplashURL)); | 
|   778  |   783  | 
|   779   login_view_->set_should_emit_login_prompt_visible(false); |   784   login_view_->set_should_emit_login_prompt_visible(false); | 
|   780  |   785  | 
|   781   app_launch_controller_.reset(new AppLaunchController( |   786   app_launch_controller_.reset(new AppLaunchController( | 
|   782       app_id, diagnostic_mode, this, GetOobeUI())); |   787       app_id, diagnostic_mode, this, GetOobeUI())); | 
|   783  |   788  | 
|   784   app_launch_controller_->StartAppLaunch(auto_launch); |   789   app_launch_controller_->StartAppLaunch(auto_launch); | 
|   785 } |   790 } | 
|   786  |   791  | 
 |   792 void LoginDisplayHostImpl::StartArcKiosk(const AccountId& account_id) { | 
 |   793   VLOG(1) << "Login WebUI >> start ARC kiosk."; | 
 |   794   SetStatusAreaVisible(false); | 
 |   795  | 
 |   796   // Animation is not supported in Mash. | 
 |   797   if (!chrome::IsRunningInMash()) | 
 |   798     finalize_animation_type_ = ANIMATION_FADE_OUT; | 
 |   799   if (!login_window_) { | 
 |   800     LoadURL(GURL(kAppLaunchSplashURL)); | 
 |   801     LoadURL(GURL(kArcKioskSplashURL)); | 
 |   802   } | 
 |   803  | 
 |   804   login_view_->set_should_emit_login_prompt_visible(false); | 
 |   805  | 
 |   806   arc_kiosk_controller_ = | 
 |   807       base::MakeUnique<ArcKioskController>(this, GetOobeUI()); | 
 |   808  | 
 |   809   arc_kiosk_controller_->StartArcKiosk(account_id); | 
 |   810 } | 
 |   811  | 
|   787 //////////////////////////////////////////////////////////////////////////////// |   812 //////////////////////////////////////////////////////////////////////////////// | 
|   788 // LoginDisplayHostImpl, public |   813 // LoginDisplayHostImpl, public | 
|   789  |   814  | 
|   790 WizardController* LoginDisplayHostImpl::CreateWizardController() { |   815 WizardController* LoginDisplayHostImpl::CreateWizardController() { | 
|   791   // TODO(altimofeev): ensure that WebUI is ready. |   816   // TODO(altimofeev): ensure that WebUI is ready. | 
|   792   OobeUI* oobe_ui = GetOobeUI(); |   817   OobeUI* oobe_ui = GetOobeUI(); | 
|   793   return new WizardController(this, oobe_ui); |   818   return new WizardController(this, oobe_ui); | 
|   794 } |   819 } | 
|   795  |   820  | 
|   796 void LoginDisplayHostImpl::OnBrowserCreated() { |   821 void LoginDisplayHostImpl::OnBrowserCreated() { | 
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1369  |  1394  | 
|  1370   locale_util::SwitchLanguageCallback callback( |  1395   locale_util::SwitchLanguageCallback callback( | 
|  1371       base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); |  1396       base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); | 
|  1372  |  1397  | 
|  1373   // Load locale keyboards here. Hardware layout would be automatically enabled. |  1398   // Load locale keyboards here. Hardware layout would be automatically enabled. | 
|  1374   locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, |  1399   locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, | 
|  1375                               callback, ProfileManager::GetActiveUserProfile()); |  1400                               callback, ProfileManager::GetActiveUserProfile()); | 
|  1376 } |  1401 } | 
|  1377  |  1402  | 
|  1378 }  // namespace chromeos |  1403 }  // namespace chromeos | 
| OLD | NEW |