Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(567)

Side by Side Diff: chrome/browser/chromeos/login/ui/login_display_host_impl.cc

Issue 1929733002: Login Screen for Mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/audio/sounds.h" 10 #include "ash/audio/sounds.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 #include "chrome/browser/chromeos/policy/enrollment_config.h" 51 #include "chrome/browser/chromeos/policy/enrollment_config.h"
52 #include "chrome/browser/chromeos/settings/cros_settings.h" 52 #include "chrome/browser/chromeos/settings/cros_settings.h"
53 #include "chrome/browser/chromeos/system/device_disabling_manager.h" 53 #include "chrome/browser/chromeos/system/device_disabling_manager.h"
54 #include "chrome/browser/chromeos/system/input_device_settings.h" 54 #include "chrome/browser/chromeos/system/input_device_settings.h"
55 #include "chrome/browser/chromeos/system/timezone_resolver_manager.h" 55 #include "chrome/browser/chromeos/system/timezone_resolver_manager.h"
56 #include "chrome/browser/chromeos/system/timezone_util.h" 56 #include "chrome/browser/chromeos/system/timezone_util.h"
57 #include "chrome/browser/chromeos/ui/focus_ring_controller.h" 57 #include "chrome/browser/chromeos/ui/focus_ring_controller.h"
58 #include "chrome/browser/lifetime/keep_alive_types.h" 58 #include "chrome/browser/lifetime/keep_alive_types.h"
59 #include "chrome/browser/lifetime/scoped_keep_alive.h" 59 #include "chrome/browser/lifetime/scoped_keep_alive.h"
60 #include "chrome/browser/profiles/profile_manager.h" 60 #include "chrome/browser/profiles/profile_manager.h"
61 #include "chrome/browser/ui/ash/ash_util.h"
61 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" 62 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h"
62 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 63 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
63 #include "chrome/common/chrome_constants.h" 64 #include "chrome/common/chrome_constants.h"
64 #include "chrome/common/chrome_switches.h" 65 #include "chrome/common/chrome_switches.h"
65 #include "chrome/common/pref_names.h" 66 #include "chrome/common/pref_names.h"
66 #include "chrome/grit/browser_resources.h" 67 #include "chrome/grit/browser_resources.h"
67 #include "chromeos/audio/chromeos_sounds.h" 68 #include "chromeos/audio/chromeos_sounds.h"
68 #include "chromeos/chromeos_constants.h" 69 #include "chromeos/chromeos_constants.h"
69 #include "chromeos/chromeos_switches.h" 70 #include "chromeos/chromeos_switches.h"
70 #include "chromeos/dbus/dbus_thread_manager.h" 71 #include "chromeos/dbus/dbus_thread_manager.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 is_wallpaper_loaded_(false), 271 is_wallpaper_loaded_(false),
271 status_area_saved_visibility_(false), 272 status_area_saved_visibility_(false),
272 crash_count_(0), 273 crash_count_(0),
273 restore_path_(RESTORE_UNKNOWN), 274 restore_path_(RESTORE_UNKNOWN),
274 finalize_animation_type_(ANIMATION_WORKSPACE), 275 finalize_animation_type_(ANIMATION_WORKSPACE),
275 startup_sound_played_(false), 276 startup_sound_played_(false),
276 startup_sound_honors_spoken_feedback_(false), 277 startup_sound_honors_spoken_feedback_(false),
277 is_observing_keyboard_(false), 278 is_observing_keyboard_(false),
278 pointer_factory_(this), 279 pointer_factory_(this),
279 animation_weak_ptr_factory_(this) { 280 animation_weak_ptr_factory_(this) {
281 if (chrome::IsRunningInMash()) {
282 finalize_animation_type_ = ANIMATION_NONE;
283 initialize_webui_hidden_ = false;
284 }
285
280 DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this); 286 DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this);
281 CrasAudioHandler::Get()->AddAudioObserver(this); 287 CrasAudioHandler::Get()->AddAudioObserver(this);
282 if (keyboard::KeyboardController::GetInstance()) { 288 if (keyboard::KeyboardController::GetInstance()) {
283 keyboard::KeyboardController::GetInstance()->AddObserver(this); 289 keyboard::KeyboardController::GetInstance()->AddObserver(this);
284 is_observing_keyboard_ = true; 290 is_observing_keyboard_ = true;
285 } 291 }
286 292
287 ash::Shell::GetInstance()->delegate()->AddVirtualKeyboardStateObserver(this); 293 if (!chrome::IsRunningInMash()) {
294 ash::Shell::GetInstance()->delegate()->AddVirtualKeyboardStateObserver(
295 this);
296 }
288 gfx::Screen::GetScreen()->AddObserver(this); 297 gfx::Screen::GetScreen()->AddObserver(this);
289 298
290 // We need to listen to CLOSE_ALL_BROWSERS_REQUEST but not APP_TERMINATING 299 // We need to listen to CLOSE_ALL_BROWSERS_REQUEST but not APP_TERMINATING
291 // because/ APP_TERMINATING will never be fired as long as this keeps 300 // because/ APP_TERMINATING will never be fired as long as this keeps
292 // ref-count. CLOSE_ALL_BROWSERS_REQUEST is safe here because there will be no 301 // ref-count. CLOSE_ALL_BROWSERS_REQUEST is safe here because there will be no
293 // browser instance that will block the shutdown. 302 // browser instance that will block the shutdown.
294 registrar_.Add(this, 303 registrar_.Add(this,
295 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, 304 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST,
296 content::NotificationService::AllSources()); 305 content::NotificationService::AllSources());
297 306
(...skipping 11 matching lines...) Expand all
309 318
310 DCHECK(default_host() == nullptr); 319 DCHECK(default_host() == nullptr);
311 default_host_ = this; 320 default_host_ = this;
312 321
313 keep_alive_.reset( 322 keep_alive_.reset(
314 new ScopedKeepAlive(KeepAliveOrigin::LOGIN_DISPLAY_HOST_IMPL, 323 new ScopedKeepAlive(KeepAliveOrigin::LOGIN_DISPLAY_HOST_IMPL,
315 KeepAliveRestartOption::DISABLED)); 324 KeepAliveRestartOption::DISABLED));
316 325
317 bool is_registered = StartupUtils::IsDeviceRegistered(); 326 bool is_registered = StartupUtils::IsDeviceRegistered();
318 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); 327 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled();
328 if (chrome::IsRunningInMash())
329 zero_delay_enabled = true;
319 bool disable_boot_animation = 330 bool disable_boot_animation =
320 base::CommandLine::ForCurrentProcess()->HasSwitch( 331 base::CommandLine::ForCurrentProcess()->HasSwitch(
321 switches::kDisableBootAnimation); 332 switches::kDisableBootAnimation);
322 333
323 waiting_for_wallpaper_load_ = !zero_delay_enabled && 334 waiting_for_wallpaper_load_ = !zero_delay_enabled &&
324 (!is_registered || !disable_boot_animation); 335 (!is_registered || !disable_boot_animation);
325 336
326 // For slower hardware we have boot animation disabled so 337 // For slower hardware we have boot animation disabled so
327 // we'll be initializing WebUI hidden, waiting for user pods to load and then 338 // we'll be initializing WebUI hidden, waiting for user pods to load and then
328 // show WebUI at once. 339 // show WebUI at once.
329 waiting_for_user_pods_ = !zero_delay_enabled && !waiting_for_wallpaper_load_; 340 waiting_for_user_pods_ = !zero_delay_enabled && !waiting_for_wallpaper_load_;
330 341
331 initialize_webui_hidden_ = 342 if (!chrome::IsRunningInMash()) {
332 kHiddenWebUIInitializationDefault && !zero_delay_enabled; 343 initialize_webui_hidden_ =
344 kHiddenWebUIInitializationDefault && !zero_delay_enabled;
345 }
333 346
334 // Check if WebUI init type is overriden. 347 // Check if WebUI init type is overriden.
335 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 348 if (!chrome::IsRunningInMash() &&
349 base::CommandLine::ForCurrentProcess()->HasSwitch(
336 switches::kAshWebUIInit)) { 350 switches::kAshWebUIInit)) {
337 const std::string override_type = 351 const std::string override_type =
338 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 352 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
339 switches::kAshWebUIInit); 353 switches::kAshWebUIInit);
340 if (override_type == kWebUIInitParallel) 354 if (override_type == kWebUIInitParallel)
341 initialize_webui_hidden_ = true; 355 initialize_webui_hidden_ = true;
342 else if (override_type == kWebUIInitPostpone) 356 else if (override_type == kWebUIInitPostpone)
343 initialize_webui_hidden_ = false; 357 initialize_webui_hidden_ = false;
344 } 358 }
345 359
(...skipping 24 matching lines...) Expand all
370 << " wait_for_wp_load_: " << waiting_for_wallpaper_load_ 384 << " wait_for_wp_load_: " << waiting_for_wallpaper_load_
371 << " wait_for_pods_: " << waiting_for_user_pods_ 385 << " wait_for_pods_: " << waiting_for_user_pods_
372 << " init_webui_hidden_: " << initialize_webui_hidden_; 386 << " init_webui_hidden_: " << initialize_webui_hidden_;
373 387
374 media::SoundsManager* manager = media::SoundsManager::Get(); 388 media::SoundsManager* manager = media::SoundsManager::Get();
375 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 389 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
376 manager->Initialize(chromeos::SOUND_STARTUP, 390 manager->Initialize(chromeos::SOUND_STARTUP,
377 bundle.GetRawDataResource(IDR_SOUND_STARTUP_WAV)); 391 bundle.GetRawDataResource(IDR_SOUND_STARTUP_WAV));
378 392
379 // Disable Drag'n'Drop for the login session. 393 // Disable Drag'n'Drop for the login session.
380 scoped_drag_drop_disabler_.reset(new aura::client::ScopedDragDropDisabler( 394 if (!chrome::IsRunningInMash()) {
381 ash::Shell::GetPrimaryRootWindow())); 395 scoped_drag_drop_disabler_.reset(new aura::client::ScopedDragDropDisabler(
396 ash::Shell::GetPrimaryRootWindow()));
397 }
382 } 398 }
383 399
384 LoginDisplayHostImpl::~LoginDisplayHostImpl() { 400 LoginDisplayHostImpl::~LoginDisplayHostImpl() {
385 DBusThreadManager::Get()->GetSessionManagerClient()->RemoveObserver(this); 401 DBusThreadManager::Get()->GetSessionManagerClient()->RemoveObserver(this);
386 CrasAudioHandler::Get()->RemoveAudioObserver(this); 402 CrasAudioHandler::Get()->RemoveAudioObserver(this);
387 if (keyboard::KeyboardController::GetInstance() && is_observing_keyboard_) { 403 if (keyboard::KeyboardController::GetInstance() && is_observing_keyboard_) {
388 keyboard::KeyboardController::GetInstance()->RemoveObserver(this); 404 keyboard::KeyboardController::GetInstance()->RemoveObserver(this);
389 is_observing_keyboard_ = false; 405 is_observing_keyboard_ = false;
390 } 406 }
391 407
392 ash::Shell::GetInstance()->delegate()-> 408 if (!chrome::IsRunningInMash()) {
393 RemoveVirtualKeyboardStateObserver(this); 409 ash::Shell::GetInstance()->delegate()->RemoveVirtualKeyboardStateObserver(
410 this);
411 }
394 gfx::Screen::GetScreen()->RemoveObserver(this); 412 gfx::Screen::GetScreen()->RemoveObserver(this);
395 413
396 if (login_view_ && login_window_) 414 if (login_view_ && login_window_)
397 login_window_->RemoveRemovalsObserver(this); 415 login_window_->RemoveRemovalsObserver(this);
398 416
399 chrome::MultiUserWindowManager* window_manager = 417 chrome::MultiUserWindowManager* window_manager =
400 chrome::MultiUserWindowManager::GetInstance(); 418 chrome::MultiUserWindowManager::GetInstance();
401 // MultiUserWindowManager instance might be null if no user is logged in - or 419 // MultiUserWindowManager instance might be null if no user is logged in - or
402 // in a unit test. 420 // in a unit test.
403 if (window_manager) 421 if (window_manager)
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 AppLaunchController* LoginDisplayHostImpl::GetAppLaunchController() { 562 AppLaunchController* LoginDisplayHostImpl::GetAppLaunchController() {
545 return app_launch_controller_.get(); 563 return app_launch_controller_.get();
546 } 564 }
547 565
548 void LoginDisplayHostImpl::StartUserAdding( 566 void LoginDisplayHostImpl::StartUserAdding(
549 const base::Closure& completion_callback) { 567 const base::Closure& completion_callback) {
550 DisableKeyboardOverscroll(); 568 DisableKeyboardOverscroll();
551 569
552 restore_path_ = RESTORE_ADD_USER_INTO_SESSION; 570 restore_path_ = RESTORE_ADD_USER_INTO_SESSION;
553 completion_callback_ = completion_callback; 571 completion_callback_ = completion_callback;
554 finalize_animation_type_ = ANIMATION_ADD_USER; 572 if (!chrome::IsRunningInMash())
573 finalize_animation_type_ = ANIMATION_ADD_USER;
555 // Observe the user switch animation and defer the deletion of itself only 574 // Observe the user switch animation and defer the deletion of itself only
556 // after the animation is finished. 575 // after the animation is finished.
557 chrome::MultiUserWindowManager* window_manager = 576 chrome::MultiUserWindowManager* window_manager =
558 chrome::MultiUserWindowManager::GetInstance(); 577 chrome::MultiUserWindowManager::GetInstance();
559 // MultiUserWindowManager instance might be null in a unit test. 578 // MultiUserWindowManager instance might be null in a unit test.
560 if (window_manager) 579 if (window_manager)
561 window_manager->AddObserver(this); 580 window_manager->AddObserver(this);
562 581
563 VLOG(1) << "Login WebUI >> user adding"; 582 VLOG(1) << "Login WebUI >> user adding";
564 if (!login_window_) 583 if (!login_window_)
565 LoadURL(GURL(kUserAddingURL)); 584 LoadURL(GURL(kUserAddingURL));
566 // We should emit this signal only at login screen (after reboot or sign out). 585 // We should emit this signal only at login screen (after reboot or sign out).
567 login_view_->set_should_emit_login_prompt_visible(false); 586 login_view_->set_should_emit_login_prompt_visible(false);
568 587
569 // Lock container can be transparent after lock screen animation. 588 if (!chrome::IsRunningInMash()) {
570 aura::Window* lock_container = ash::Shell::GetContainer( 589 // Lock container can be transparent after lock screen animation.
571 ash::Shell::GetPrimaryRootWindow(), 590 aura::Window* lock_container = ash::Shell::GetContainer(
572 ash::kShellWindowId_LockScreenContainersContainer); 591 ash::Shell::GetPrimaryRootWindow(),
573 lock_container->layer()->SetOpacity(1.0); 592 ash::kShellWindowId_LockScreenContainersContainer);
593 lock_container->layer()->SetOpacity(1.0);
574 594
575 ash::Shell::GetInstance()-> 595 ash::Shell::GetInstance()
576 desktop_background_controller()->MoveDesktopToLockedContainer(); 596 ->desktop_background_controller()
597 ->MoveDesktopToLockedContainer();
598 }
577 599
578 existing_user_controller_.reset(); // Only one controller in a time. 600 existing_user_controller_.reset(); // Only one controller in a time.
579 existing_user_controller_.reset(new chromeos::ExistingUserController(this)); 601 existing_user_controller_.reset(new chromeos::ExistingUserController(this));
580 602
581 if (!signin_screen_controller_.get()) { 603 if (!signin_screen_controller_.get()) {
582 signin_screen_controller_.reset(new SignInScreenController( 604 signin_screen_controller_.reset(new SignInScreenController(
583 GetOobeUI(), webui_login_display_->delegate())); 605 GetOobeUI(), webui_login_display_->delegate()));
584 } 606 }
585 607
586 SetOobeProgressBarVisible(oobe_progress_bar_visible_ = false); 608 SetOobeProgressBarVisible(oobe_progress_bar_visible_ = false);
(...skipping 17 matching lines...) Expand all
604 626
605 void LoginDisplayHostImpl::StartSignInScreen( 627 void LoginDisplayHostImpl::StartSignInScreen(
606 const LoginScreenContext& context) { 628 const LoginScreenContext& context) {
607 DisableKeyboardOverscroll(); 629 DisableKeyboardOverscroll();
608 630
609 startup_sound_honors_spoken_feedback_ = true; 631 startup_sound_honors_spoken_feedback_ = true;
610 TryToPlayStartupSound(); 632 TryToPlayStartupSound();
611 633
612 restore_path_ = RESTORE_SIGN_IN; 634 restore_path_ = RESTORE_SIGN_IN;
613 is_showing_login_ = true; 635 is_showing_login_ = true;
614 finalize_animation_type_ = ANIMATION_WORKSPACE; 636 if (!chrome::IsRunningInMash())
637 finalize_animation_type_ = ANIMATION_WORKSPACE;
615 638
616 PrewarmAuthentication(); 639 PrewarmAuthentication();
617 640
618 if (waiting_for_wallpaper_load_ && !initialize_webui_hidden_) { 641 if (waiting_for_wallpaper_load_ && !initialize_webui_hidden_) {
619 VLOG(1) << "Login WebUI >> sign in postponed"; 642 VLOG(1) << "Login WebUI >> sign in postponed";
620 return; 643 return;
621 } 644 }
622 VLOG(1) << "Login WebUI >> sign in"; 645 VLOG(1) << "Login WebUI >> sign in";
623 646
624 if (!login_window_) { 647 if (!login_window_) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 752
730 bool device_disabled = false; 753 bool device_disabled = false;
731 CrosSettings::Get()->GetBoolean(kDeviceDisabled, &device_disabled); 754 CrosSettings::Get()->GetBoolean(kDeviceDisabled, &device_disabled);
732 if (device_disabled && system::DeviceDisablingManager:: 755 if (device_disabled && system::DeviceDisablingManager::
733 HonorDeviceDisablingDuringNormalOperation()) { 756 HonorDeviceDisablingDuringNormalOperation()) {
734 // If the device is disabled, bail out. A device disabled screen will be 757 // If the device is disabled, bail out. A device disabled screen will be
735 // shown by the DeviceDisablingManager. 758 // shown by the DeviceDisablingManager.
736 return; 759 return;
737 } 760 }
738 761
739 finalize_animation_type_ = ANIMATION_FADE_OUT; 762 if (!chrome::IsRunningInMash())
763 finalize_animation_type_ = ANIMATION_FADE_OUT;
740 if (!login_window_) 764 if (!login_window_)
741 LoadURL(GURL(kAppLaunchSplashURL)); 765 LoadURL(GURL(kAppLaunchSplashURL));
742 766
743 login_view_->set_should_emit_login_prompt_visible(false); 767 login_view_->set_should_emit_login_prompt_visible(false);
744 768
745 app_launch_controller_.reset(new AppLaunchController( 769 app_launch_controller_.reset(new AppLaunchController(
746 app_id, diagnostic_mode, this, GetOobeUI())); 770 app_id, diagnostic_mode, this, GetOobeUI()));
747 771
748 app_launch_controller_->StartAppLaunch(auto_launch); 772 app_launch_controller_->StartAppLaunch(auto_launch);
749 } 773 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 // example) are ignored. 823 // example) are ignored.
800 OnBrowserCreated(); 824 OnBrowserCreated();
801 registrar_.Remove(this, 825 registrar_.Remove(this,
802 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, 826 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST,
803 content::NotificationService::AllSources()); 827 content::NotificationService::AllSources());
804 registrar_.Remove(this, 828 registrar_.Remove(this,
805 chrome::NOTIFICATION_BROWSER_OPENED, 829 chrome::NOTIFICATION_BROWSER_OPENED,
806 content::NotificationService::AllSources()); 830 content::NotificationService::AllSources());
807 } else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED && 831 } else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED &&
808 user_manager::UserManager::Get()->IsCurrentUserNew()) { 832 user_manager::UserManager::Get()->IsCurrentUserNew()) {
809 // For new user, move desktop to locker container so that windows created 833 if (!chrome::IsRunningInMash()) {
810 // during the user image picker step are below it. 834 // For new user, move desktop to locker container so that windows created
811 ash::Shell::GetInstance()-> 835 // during the user image picker step are below it.
812 desktop_background_controller()->MoveDesktopToLockedContainer(); 836 ash::Shell::GetInstance()
837 ->desktop_background_controller()
838 ->MoveDesktopToLockedContainer();
839 }
813 registrar_.Remove(this, 840 registrar_.Remove(this,
814 chrome::NOTIFICATION_LOGIN_USER_CHANGED, 841 chrome::NOTIFICATION_LOGIN_USER_CHANGED,
815 content::NotificationService::AllSources()); 842 content::NotificationService::AllSources());
816 } else if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) { 843 } else if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) {
817 VLOG(1) << "Login WebUI >> wp animation done"; 844 VLOG(1) << "Login WebUI >> wp animation done";
818 is_wallpaper_loaded_ = true; 845 is_wallpaper_loaded_ = true;
819 ash::Shell::GetInstance()->user_wallpaper_delegate() 846 if (!chrome::IsRunningInMash()) {
820 ->OnWallpaperBootAnimationFinished(); 847 ash::Shell::GetInstance()
848 ->user_wallpaper_delegate()
849 ->OnWallpaperBootAnimationFinished();
850 }
821 if (waiting_for_wallpaper_load_) { 851 if (waiting_for_wallpaper_load_) {
822 // StartWizard / StartSignInScreen could be called multiple times through 852 // StartWizard / StartSignInScreen could be called multiple times through
823 // the lifetime of host. 853 // the lifetime of host.
824 // Make sure that subsequent calls are not postponed. 854 // Make sure that subsequent calls are not postponed.
825 waiting_for_wallpaper_load_ = false; 855 waiting_for_wallpaper_load_ = false;
826 if (initialize_webui_hidden_) 856 if (initialize_webui_hidden_)
827 ShowWebUI(); 857 ShowWebUI();
828 else 858 else
829 StartPostponedWebUI(); 859 StartPostponedWebUI();
830 } 860 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 shutting_down_ = true; 987 shutting_down_ = true;
958 registrar_.RemoveAll(); 988 registrar_.RemoveAll();
959 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); 989 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
960 if (post_quit_task) 990 if (post_quit_task)
961 base::MessageLoop::current()->QuitWhenIdle(); 991 base::MessageLoop::current()->QuitWhenIdle();
962 992
963 if (!completion_callback_.is_null()) 993 if (!completion_callback_.is_null())
964 base::MessageLoop::current()->PostTask(FROM_HERE, completion_callback_); 994 base::MessageLoop::current()->PostTask(FROM_HERE, completion_callback_);
965 995
966 if (ash::Shell::HasInstance() && 996 if (ash::Shell::HasInstance() &&
967 finalize_animation_type_ == ANIMATION_ADD_USER) { 997 finalize_animation_type_ == ANIMATION_ADD_USER &&
998 !chrome::IsRunningInMash()) {
968 ash::Shell::GetInstance() 999 ash::Shell::GetInstance()
969 ->desktop_background_controller() 1000 ->desktop_background_controller()
970 ->MoveDesktopToUnlockedContainer(); 1001 ->MoveDesktopToUnlockedContainer();
971 } 1002 }
972 } 1003 }
973 1004
974 void LoginDisplayHostImpl::ScheduleWorkspaceAnimation() { 1005 void LoginDisplayHostImpl::ScheduleWorkspaceAnimation() {
1006 if (chrome::IsRunningInMash())
1007 return;
975 if (ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), 1008 if (ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
976 ash::kShellWindowId_DesktopBackgroundContainer) 1009 ash::kShellWindowId_DesktopBackgroundContainer)
977 ->children() 1010 ->children()
978 .empty()) { 1011 .empty()) {
979 // If there is no background window, don't perform any animation on the 1012 // If there is no background window, don't perform any animation on the
980 // default and background layer because there is nothing behind it. 1013 // default and background layer because there is nothing behind it.
981 return; 1014 return;
982 } 1015 }
983 1016
984 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 1017 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 focus_ring_controller_->SetVisible(true); 1103 focus_ring_controller_->SetVisible(true);
1071 1104
1072 keyboard_driven_oobe_key_handler_.reset(new KeyboardDrivenOobeKeyHandler); 1105 keyboard_driven_oobe_key_handler_.reset(new KeyboardDrivenOobeKeyHandler);
1073 } 1106 }
1074 1107
1075 views::Widget::InitParams params( 1108 views::Widget::InitParams params(
1076 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 1109 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
1077 params.bounds = background_bounds(); 1110 params.bounds = background_bounds();
1078 params.show_state = ui::SHOW_STATE_FULLSCREEN; 1111 params.show_state = ui::SHOW_STATE_FULLSCREEN;
1079 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 1112 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
1080 params.parent = 1113 if (!chrome::IsRunningInMash()) {
1081 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), 1114 params.parent =
1082 ash::kShellWindowId_LockScreenContainer); 1115 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
1116 ash::kShellWindowId_LockScreenContainer);
1117 }
1083 login_window_ = new views::Widget; 1118 login_window_ = new views::Widget;
1084 params.delegate = new LoginWidgetDelegate(login_window_); 1119 params.delegate = new LoginWidgetDelegate(login_window_);
1085 login_window_->Init(params); 1120 login_window_->Init(params);
1086 1121
1087 login_view_ = new WebUILoginView(); 1122 login_view_ = new WebUILoginView();
1088 login_view_->Init(); 1123 login_view_->Init();
1089 if (login_view_->webui_visible()) 1124 if (login_view_->webui_visible())
1090 OnLoginPromptVisible(); 1125 OnLoginPromptVisible();
1091 1126
1092 login_window_->SetVisibilityAnimationDuration( 1127 if (!chrome::IsRunningInMash()) {
1093 base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs)); 1128 login_window_->SetVisibilityAnimationDuration(
1094 login_window_->SetVisibilityAnimationTransition(views::Widget::ANIMATE_HIDE); 1129 base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs));
1130 login_window_->SetVisibilityAnimationTransition(
1131 views::Widget::ANIMATE_HIDE);
1132 }
1095 1133
1096 login_window_->AddRemovalsObserver(this); 1134 login_window_->AddRemovalsObserver(this);
1097 login_window_->SetContentsView(login_view_); 1135 login_window_->SetContentsView(login_view_);
1098 1136
1099 // If WebUI is initialized in hidden state, show it only if we're no 1137 // If WebUI is initialized in hidden state, show it only if we're no
1100 // longer waiting for wallpaper animation/user images loading. Otherwise, 1138 // longer waiting for wallpaper animation/user images loading. Otherwise,
1101 // always show it. 1139 // always show it.
1102 if (!initialize_webui_hidden_ || 1140 if (!initialize_webui_hidden_ ||
1103 (!waiting_for_wallpaper_load_ && !waiting_for_user_pods_)) { 1141 (!waiting_for_wallpaper_load_ && !waiting_for_user_pods_)) {
1104 VLOG(1) << "Login WebUI >> show login wnd on create"; 1142 VLOG(1) << "Login WebUI >> show login wnd on create";
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 1343
1306 locale_util::SwitchLanguageCallback callback( 1344 locale_util::SwitchLanguageCallback callback(
1307 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); 1345 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data))));
1308 1346
1309 // Load locale keyboards here. Hardware layout would be automatically enabled. 1347 // Load locale keyboards here. Hardware layout would be automatically enabled.
1310 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, 1348 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */,
1311 callback, ProfileManager::GetActiveUserProfile()); 1349 callback, ProfileManager::GetActiveUserProfile());
1312 } 1350 }
1313 1351
1314 } // namespace chromeos 1352 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698