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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 // Maximum delay for startup sound after 'loginPromptVisible' signal. | 104 // Maximum delay for startup sound after 'loginPromptVisible' signal. |
105 const int kStartupSoundMaxDelayMs = 2000; | 105 const int kStartupSoundMaxDelayMs = 2000; |
106 | 106 |
107 // URL which corresponds to the login WebUI. | 107 // URL which corresponds to the login WebUI. |
108 const char kLoginURL[] = "chrome://oobe/login"; | 108 const char kLoginURL[] = "chrome://oobe/login"; |
109 | 109 |
110 // URL which corresponds to the OOBE WebUI. | 110 // URL which corresponds to the OOBE WebUI. |
111 const char kOobeURL[] = "chrome://oobe/oobe"; | 111 const char kOobeURL[] = "chrome://oobe/oobe"; |
112 | 112 |
113 // URL which corresponds to the new implementation of OOBE WebUI. | |
114 const char kNewOobeURL[] = "chrome://oobe-md/"; | |
115 | |
116 // URL which corresponds to the user adding WebUI. | 113 // URL which corresponds to the user adding WebUI. |
117 const char kUserAddingURL[] = "chrome://oobe/user-adding"; | 114 const char kUserAddingURL[] = "chrome://oobe/user-adding"; |
118 | 115 |
119 // URL which corresponds to the app launch splash WebUI. | 116 // URL which corresponds to the app launch splash WebUI. |
120 const char kAppLaunchSplashURL[] = "chrome://oobe/app-launch-splash"; | 117 const char kAppLaunchSplashURL[] = "chrome://oobe/app-launch-splash"; |
121 | 118 |
122 // Duration of sign-in transition animation. | 119 // Duration of sign-in transition animation. |
123 const int kLoginFadeoutTransitionDurationMs = 700; | 120 const int kLoginFadeoutTransitionDurationMs = 700; |
124 | 121 |
125 // Number of times we try to reload OOBE/login WebUI if it crashes. | 122 // Number of times we try to reload OOBE/login WebUI if it crashes. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 webui_login_display_(NULL), | 264 webui_login_display_(NULL), |
268 is_showing_login_(false), | 265 is_showing_login_(false), |
269 is_wallpaper_loaded_(false), | 266 is_wallpaper_loaded_(false), |
270 status_area_saved_visibility_(false), | 267 status_area_saved_visibility_(false), |
271 crash_count_(0), | 268 crash_count_(0), |
272 restore_path_(RESTORE_UNKNOWN), | 269 restore_path_(RESTORE_UNKNOWN), |
273 finalize_animation_type_(ANIMATION_WORKSPACE), | 270 finalize_animation_type_(ANIMATION_WORKSPACE), |
274 startup_sound_played_(false), | 271 startup_sound_played_(false), |
275 startup_sound_honors_spoken_feedback_(false), | 272 startup_sound_honors_spoken_feedback_(false), |
276 is_observing_keyboard_(false), | 273 is_observing_keyboard_(false), |
277 is_new_oobe_(false), | |
278 pointer_factory_(this), | 274 pointer_factory_(this), |
279 animation_weak_ptr_factory_(this) { | 275 animation_weak_ptr_factory_(this) { |
280 DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this); | 276 DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this); |
281 CrasAudioHandler::Get()->AddAudioObserver(this); | 277 CrasAudioHandler::Get()->AddAudioObserver(this); |
282 if (keyboard::KeyboardController::GetInstance()) { | 278 if (keyboard::KeyboardController::GetInstance()) { |
283 keyboard::KeyboardController::GetInstance()->AddObserver(this); | 279 keyboard::KeyboardController::GetInstance()->AddObserver(this); |
284 is_observing_keyboard_ = true; | 280 is_observing_keyboard_ = true; |
285 } | 281 } |
286 | 282 |
287 ash::Shell::GetInstance()->delegate()->AddVirtualKeyboardStateObserver(this); | 283 ash::Shell::GetInstance()->delegate()->AddVirtualKeyboardStateObserver(this); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 restore_path_ = RESTORE_WIZARD; | 490 restore_path_ = RESTORE_WIZARD; |
495 first_screen_name_ = first_screen_name; | 491 first_screen_name_ = first_screen_name; |
496 is_showing_login_ = false; | 492 is_showing_login_ = false; |
497 | 493 |
498 if (waiting_for_wallpaper_load_ && !initialize_webui_hidden_) { | 494 if (waiting_for_wallpaper_load_ && !initialize_webui_hidden_) { |
499 VLOG(1) << "Login WebUI >> wizard postponed"; | 495 VLOG(1) << "Login WebUI >> wizard postponed"; |
500 return; | 496 return; |
501 } | 497 } |
502 VLOG(1) << "Login WebUI >> wizard"; | 498 VLOG(1) << "Login WebUI >> wizard"; |
503 | 499 |
504 if (!login_window_) { | 500 if (!login_window_) |
505 is_new_oobe_ = StartupUtils::IsNewOobeActivated(); | 501 LoadURL(GURL(kOobeURL)); |
506 LoadURL(is_new_oobe_ ? GURL(kNewOobeURL) : GURL(kOobeURL)); | |
507 } | |
508 | 502 |
509 DVLOG(1) << "Starting wizard, first_screen_name: " << first_screen_name; | 503 DVLOG(1) << "Starting wizard, first_screen_name: " << first_screen_name; |
510 // Create and show the wizard. | 504 // Create and show the wizard. |
511 // Note, dtor of the old WizardController should be called before ctor of the | 505 // Note, dtor of the old WizardController should be called before ctor of the |
512 // new one, because "default_controller()" is updated there. So pure "reset()" | 506 // new one, because "default_controller()" is updated there. So pure "reset()" |
513 // is done before new controller creation. | 507 // is done before new controller creation. |
514 wizard_controller_.reset(); | 508 wizard_controller_.reset(); |
515 wizard_controller_.reset(CreateWizardController()); | 509 wizard_controller_.reset(CreateWizardController()); |
516 | 510 |
517 if (is_new_oobe_) | |
518 return; | |
519 | |
520 oobe_progress_bar_visible_ = !StartupUtils::IsDeviceRegistered(); | 511 oobe_progress_bar_visible_ = !StartupUtils::IsDeviceRegistered(); |
521 SetOobeProgressBarVisible(oobe_progress_bar_visible_); | 512 SetOobeProgressBarVisible(oobe_progress_bar_visible_); |
522 wizard_controller_->Init(first_screen_name); | 513 wizard_controller_->Init(first_screen_name); |
523 } | 514 } |
524 | 515 |
525 WizardController* LoginDisplayHostImpl::GetWizardController() { | 516 WizardController* LoginDisplayHostImpl::GetWizardController() { |
526 return wizard_controller_.get(); | 517 return wizard_controller_.get(); |
527 } | 518 } |
528 | 519 |
529 AppLaunchController* LoginDisplayHostImpl::GetAppLaunchController() { | 520 AppLaunchController* LoginDisplayHostImpl::GetAppLaunchController() { |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 | 1260 |
1270 locale_util::SwitchLanguageCallback callback( | 1261 locale_util::SwitchLanguageCallback callback( |
1271 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))); | 1262 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))); |
1272 | 1263 |
1273 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1264 // Load locale keyboards here. Hardware layout would be automatically enabled. |
1274 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, | 1265 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, |
1275 callback, ProfileManager::GetActiveUserProfile()); | 1266 callback, ProfileManager::GetActiveUserProfile()); |
1276 } | 1267 } |
1277 | 1268 |
1278 } // namespace chromeos | 1269 } // namespace chromeos |
OLD | NEW |