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/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 334 |
335 void LoginDisplayHostDestroyed() { login_display_host_ = nullptr; } | 335 void LoginDisplayHostDestroyed() { login_display_host_ = nullptr; } |
336 | 336 |
337 // Overridden from WidgetDelegate: | 337 // Overridden from WidgetDelegate: |
338 void WindowClosing() override { | 338 void WindowClosing() override { |
339 // Reset the cached Widget and View pointers. The Widget may close due to: | 339 // Reset the cached Widget and View pointers. The Widget may close due to: |
340 // * Login completion | 340 // * Login completion |
341 // * Ash crash at the login screen on mustash | 341 // * Ash crash at the login screen on mustash |
342 // In the latter case the mash root process will trigger a clean restart | 342 // In the latter case the mash root process will trigger a clean restart |
343 // of content_browser. | 343 // of content_browser. |
344 if (ash_util::IsRunningInMash() && login_display_host_) | 344 if (IsRunningInMash() && login_display_host_) |
345 login_display_host_->ResetLoginWindowAndView(); | 345 login_display_host_->ResetLoginWindowAndView(); |
346 } | 346 } |
347 void DeleteDelegate() override { delete this; } | 347 void DeleteDelegate() override { delete this; } |
348 views::Widget* GetWidget() override { return widget_; } | 348 views::Widget* GetWidget() override { return widget_; } |
349 const views::Widget* GetWidget() const override { return widget_; } | 349 const views::Widget* GetWidget() const override { return widget_; } |
350 bool CanActivate() const override { return true; } | 350 bool CanActivate() const override { return true; } |
351 bool ShouldAdvanceFocusToTopLevelWidget() const override { return true; } | 351 bool ShouldAdvanceFocusToTopLevelWidget() const override { return true; } |
352 | 352 |
353 private: | 353 private: |
354 views::Widget* widget_; | 354 views::Widget* widget_; |
355 // Set to null if LoginDisplayHostImpl is destroyed before us. | 355 // Set to null if LoginDisplayHostImpl is destroyed before us. |
356 LoginDisplayHostImpl* login_display_host_; | 356 LoginDisplayHostImpl* login_display_host_; |
357 | 357 |
358 DISALLOW_COPY_AND_ASSIGN(LoginWidgetDelegate); | 358 DISALLOW_COPY_AND_ASSIGN(LoginWidgetDelegate); |
359 }; | 359 }; |
360 | 360 |
361 //////////////////////////////////////////////////////////////////////////////// | 361 //////////////////////////////////////////////////////////////////////////////// |
362 // LoginDisplayHostImpl, public | 362 // LoginDisplayHostImpl, public |
363 | 363 |
364 LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& wallpaper_bounds) | 364 LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& wallpaper_bounds) |
365 : wallpaper_bounds_(wallpaper_bounds), | 365 : wallpaper_bounds_(wallpaper_bounds), |
366 pointer_factory_(this), | 366 pointer_factory_(this), |
367 animation_weak_ptr_factory_(this) { | 367 animation_weak_ptr_factory_(this) { |
368 if (ash_util::IsRunningInMash()) { | 368 if (IsRunningInMash()) { |
369 // Animation, and initializing hidden, are not currently supported for Mash. | 369 // Animation, and initializing hidden, are not currently supported for Mash. |
370 finalize_animation_type_ = ANIMATION_NONE; | 370 finalize_animation_type_ = ANIMATION_NONE; |
371 initialize_webui_hidden_ = false; | 371 initialize_webui_hidden_ = false; |
372 } | 372 } |
373 | 373 |
374 DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this); | 374 DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this); |
375 CrasAudioHandler::Get()->AddAudioObserver(this); | 375 CrasAudioHandler::Get()->AddAudioObserver(this); |
376 if (keyboard::KeyboardController::GetInstance()) { | 376 if (keyboard::KeyboardController::GetInstance()) { |
377 keyboard::KeyboardController::GetInstance()->AddObserver(this); | 377 keyboard::KeyboardController::GetInstance()->AddObserver(this); |
378 is_observing_keyboard_ = true; | 378 is_observing_keyboard_ = true; |
379 } | 379 } |
380 | 380 |
381 if (!ash_util::IsRunningInMash()) | 381 if (!IsRunningInMash()) |
382 ash::WmShell::Get()->AddShellObserver(this); | 382 ash::WmShell::Get()->AddShellObserver(this); |
383 else | 383 else |
384 NOTIMPLEMENTED(); | 384 NOTIMPLEMENTED(); |
385 display::Screen::GetScreen()->AddObserver(this); | 385 display::Screen::GetScreen()->AddObserver(this); |
386 | 386 |
387 // We need to listen to CLOSE_ALL_BROWSERS_REQUEST but not APP_TERMINATING | 387 // We need to listen to CLOSE_ALL_BROWSERS_REQUEST but not APP_TERMINATING |
388 // because/ APP_TERMINATING will never be fired as long as this keeps | 388 // because/ APP_TERMINATING will never be fired as long as this keeps |
389 // ref-count. CLOSE_ALL_BROWSERS_REQUEST is safe here because there will be no | 389 // ref-count. CLOSE_ALL_BROWSERS_REQUEST is safe here because there will be no |
390 // browser instance that will block the shutdown. | 390 // browser instance that will block the shutdown. |
391 registrar_.Add(this, | 391 registrar_.Add(this, |
(...skipping 15 matching lines...) Expand all Loading... |
407 DCHECK(default_host() == nullptr); | 407 DCHECK(default_host() == nullptr); |
408 default_host_ = this; | 408 default_host_ = this; |
409 | 409 |
410 keep_alive_.reset( | 410 keep_alive_.reset( |
411 new ScopedKeepAlive(KeepAliveOrigin::LOGIN_DISPLAY_HOST_IMPL, | 411 new ScopedKeepAlive(KeepAliveOrigin::LOGIN_DISPLAY_HOST_IMPL, |
412 KeepAliveRestartOption::DISABLED)); | 412 KeepAliveRestartOption::DISABLED)); |
413 | 413 |
414 bool is_registered = StartupUtils::IsDeviceRegistered(); | 414 bool is_registered = StartupUtils::IsDeviceRegistered(); |
415 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); | 415 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); |
416 // Mash always runs login screen with zero delay | 416 // Mash always runs login screen with zero delay |
417 if (ash_util::IsRunningInMash()) | 417 if (IsRunningInMash()) |
418 zero_delay_enabled = true; | 418 zero_delay_enabled = true; |
419 bool disable_boot_animation = | 419 bool disable_boot_animation = |
420 base::CommandLine::ForCurrentProcess()->HasSwitch( | 420 base::CommandLine::ForCurrentProcess()->HasSwitch( |
421 switches::kDisableBootAnimation); | 421 switches::kDisableBootAnimation); |
422 | 422 |
423 waiting_for_wallpaper_load_ = !zero_delay_enabled && | 423 waiting_for_wallpaper_load_ = !zero_delay_enabled && |
424 (!is_registered || !disable_boot_animation); | 424 (!is_registered || !disable_boot_animation); |
425 | 425 |
426 // For slower hardware we have boot animation disabled so | 426 // For slower hardware we have boot animation disabled so |
427 // we'll be initializing WebUI hidden, waiting for user pods to load and then | 427 // we'll be initializing WebUI hidden, waiting for user pods to load and then |
428 // show WebUI at once. | 428 // show WebUI at once. |
429 waiting_for_user_pods_ = !zero_delay_enabled && !waiting_for_wallpaper_load_; | 429 waiting_for_user_pods_ = !zero_delay_enabled && !waiting_for_wallpaper_load_; |
430 | 430 |
431 // Initializing hidden is not supported in Mash | 431 // Initializing hidden is not supported in Mash |
432 if (!ash_util::IsRunningInMash()) { | 432 if (!IsRunningInMash()) { |
433 initialize_webui_hidden_ = | 433 initialize_webui_hidden_ = |
434 kHiddenWebUIInitializationDefault && !zero_delay_enabled; | 434 kHiddenWebUIInitializationDefault && !zero_delay_enabled; |
435 } | 435 } |
436 | 436 |
437 // Check if WebUI init type is overriden. Not supported in Mash. | 437 // Check if WebUI init type is overriden. Not supported in Mash. |
438 if (!ash_util::IsRunningInMash() && | 438 if (!IsRunningInMash() && |
439 base::CommandLine::ForCurrentProcess()->HasSwitch( | 439 base::CommandLine::ForCurrentProcess()->HasSwitch( |
440 switches::kAshWebUIInit)) { | 440 switches::kAshWebUIInit)) { |
441 const std::string override_type = | 441 const std::string override_type = |
442 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 442 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
443 switches::kAshWebUIInit); | 443 switches::kAshWebUIInit); |
444 if (override_type == kWebUIInitParallel) | 444 if (override_type == kWebUIInitParallel) |
445 initialize_webui_hidden_ = true; | 445 initialize_webui_hidden_ = true; |
446 else if (override_type == kWebUIInitPostpone) | 446 else if (override_type == kWebUIInitPostpone) |
447 initialize_webui_hidden_ = false; | 447 initialize_webui_hidden_ = false; |
448 } | 448 } |
(...skipping 25 matching lines...) Expand all Loading... |
474 << " wait_for_wp_load_: " << waiting_for_wallpaper_load_ | 474 << " wait_for_wp_load_: " << waiting_for_wallpaper_load_ |
475 << " wait_for_pods_: " << waiting_for_user_pods_ | 475 << " wait_for_pods_: " << waiting_for_user_pods_ |
476 << " init_webui_hidden_: " << initialize_webui_hidden_; | 476 << " init_webui_hidden_: " << initialize_webui_hidden_; |
477 | 477 |
478 media::SoundsManager* manager = media::SoundsManager::Get(); | 478 media::SoundsManager* manager = media::SoundsManager::Get(); |
479 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 479 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
480 manager->Initialize(chromeos::SOUND_STARTUP, | 480 manager->Initialize(chromeos::SOUND_STARTUP, |
481 bundle.GetRawDataResource(IDR_SOUND_STARTUP_WAV)); | 481 bundle.GetRawDataResource(IDR_SOUND_STARTUP_WAV)); |
482 | 482 |
483 // Disable Drag'n'Drop for the login session. | 483 // Disable Drag'n'Drop for the login session. |
484 if (!ash_util::IsRunningInMash()) { | 484 if (!IsRunningInMash()) { |
485 scoped_drag_drop_disabler_.reset(new aura::client::ScopedDragDropDisabler( | 485 scoped_drag_drop_disabler_.reset(new aura::client::ScopedDragDropDisabler( |
486 ash::Shell::GetPrimaryRootWindow())); | 486 ash::Shell::GetPrimaryRootWindow())); |
487 } else { | 487 } else { |
488 NOTIMPLEMENTED(); | 488 NOTIMPLEMENTED(); |
489 } | 489 } |
490 } | 490 } |
491 | 491 |
492 LoginDisplayHostImpl::~LoginDisplayHostImpl() { | 492 LoginDisplayHostImpl::~LoginDisplayHostImpl() { |
493 DBusThreadManager::Get()->GetSessionManagerClient()->RemoveObserver(this); | 493 DBusThreadManager::Get()->GetSessionManagerClient()->RemoveObserver(this); |
494 CrasAudioHandler::Get()->RemoveAudioObserver(this); | 494 CrasAudioHandler::Get()->RemoveAudioObserver(this); |
495 if (keyboard::KeyboardController::GetInstance() && is_observing_keyboard_) { | 495 if (keyboard::KeyboardController::GetInstance() && is_observing_keyboard_) { |
496 keyboard::KeyboardController::GetInstance()->RemoveObserver(this); | 496 keyboard::KeyboardController::GetInstance()->RemoveObserver(this); |
497 is_observing_keyboard_ = false; | 497 is_observing_keyboard_ = false; |
498 } | 498 } |
499 | 499 |
500 if (!ash_util::IsRunningInMash()) | 500 if (!IsRunningInMash()) |
501 ash::WmShell::Get()->RemoveShellObserver(this); | 501 ash::WmShell::Get()->RemoveShellObserver(this); |
502 else | 502 else |
503 NOTIMPLEMENTED(); | 503 NOTIMPLEMENTED(); |
504 display::Screen::GetScreen()->RemoveObserver(this); | 504 display::Screen::GetScreen()->RemoveObserver(this); |
505 | 505 |
506 if (login_view_ && login_window_) | 506 if (login_view_ && login_window_) |
507 login_window_->RemoveRemovalsObserver(this); | 507 login_window_->RemoveRemovalsObserver(this); |
508 | 508 |
509 if (login_window_delegate_) | 509 if (login_window_delegate_) |
510 login_window_delegate_->LoginDisplayHostDestroyed(); | 510 login_window_delegate_->LoginDisplayHostDestroyed(); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 return app_launch_controller_.get(); | 655 return app_launch_controller_.get(); |
656 } | 656 } |
657 | 657 |
658 void LoginDisplayHostImpl::StartUserAdding( | 658 void LoginDisplayHostImpl::StartUserAdding( |
659 const base::Closure& completion_callback) { | 659 const base::Closure& completion_callback) { |
660 DisableKeyboardOverscroll(); | 660 DisableKeyboardOverscroll(); |
661 | 661 |
662 restore_path_ = RESTORE_ADD_USER_INTO_SESSION; | 662 restore_path_ = RESTORE_ADD_USER_INTO_SESSION; |
663 completion_callback_ = completion_callback; | 663 completion_callback_ = completion_callback; |
664 // Animation is not supported in Mash | 664 // Animation is not supported in Mash |
665 if (!ash_util::IsRunningInMash()) | 665 if (!IsRunningInMash()) |
666 finalize_animation_type_ = ANIMATION_ADD_USER; | 666 finalize_animation_type_ = ANIMATION_ADD_USER; |
667 // Observe the user switch animation and defer the deletion of itself only | 667 // Observe the user switch animation and defer the deletion of itself only |
668 // after the animation is finished. | 668 // after the animation is finished. |
669 chrome::MultiUserWindowManager* window_manager = | 669 chrome::MultiUserWindowManager* window_manager = |
670 chrome::MultiUserWindowManager::GetInstance(); | 670 chrome::MultiUserWindowManager::GetInstance(); |
671 // MultiUserWindowManager instance might be nullptr in a unit test. | 671 // MultiUserWindowManager instance might be nullptr in a unit test. |
672 if (window_manager) | 672 if (window_manager) |
673 window_manager->AddObserver(this); | 673 window_manager->AddObserver(this); |
674 | 674 |
675 VLOG(1) << "Login WebUI >> user adding"; | 675 VLOG(1) << "Login WebUI >> user adding"; |
676 if (!login_window_) | 676 if (!login_window_) |
677 LoadURL(GURL(kUserAddingURL)); | 677 LoadURL(GURL(kUserAddingURL)); |
678 // We should emit this signal only at login screen (after reboot or sign out). | 678 // We should emit this signal only at login screen (after reboot or sign out). |
679 login_view_->set_should_emit_login_prompt_visible(false); | 679 login_view_->set_should_emit_login_prompt_visible(false); |
680 | 680 |
681 if (!ash_util::IsRunningInMash()) { | 681 if (!IsRunningInMash()) { |
682 // Lock container can be transparent after lock screen animation. | 682 // Lock container can be transparent after lock screen animation. |
683 aura::Window* lock_container = ash::Shell::GetContainer( | 683 aura::Window* lock_container = ash::Shell::GetContainer( |
684 ash::Shell::GetPrimaryRootWindow(), | 684 ash::Shell::GetPrimaryRootWindow(), |
685 ash::kShellWindowId_LockScreenContainersContainer); | 685 ash::kShellWindowId_LockScreenContainersContainer); |
686 lock_container->layer()->SetOpacity(1.0); | 686 lock_container->layer()->SetOpacity(1.0); |
687 | 687 |
688 ash::WmShell::Get()->wallpaper_controller()->MoveToLockedContainer(); | 688 ash::WmShell::Get()->wallpaper_controller()->MoveToLockedContainer(); |
689 } else { | 689 } else { |
690 NOTIMPLEMENTED(); | 690 NOTIMPLEMENTED(); |
691 } | 691 } |
(...skipping 28 matching lines...) Expand all Loading... |
720 void LoginDisplayHostImpl::StartSignInScreen( | 720 void LoginDisplayHostImpl::StartSignInScreen( |
721 const LoginScreenContext& context) { | 721 const LoginScreenContext& context) { |
722 DisableKeyboardOverscroll(); | 722 DisableKeyboardOverscroll(); |
723 | 723 |
724 startup_sound_honors_spoken_feedback_ = true; | 724 startup_sound_honors_spoken_feedback_ = true; |
725 TryToPlayStartupSound(); | 725 TryToPlayStartupSound(); |
726 | 726 |
727 restore_path_ = RESTORE_SIGN_IN; | 727 restore_path_ = RESTORE_SIGN_IN; |
728 is_showing_login_ = true; | 728 is_showing_login_ = true; |
729 // Animation is not supported in Mash | 729 // Animation is not supported in Mash |
730 if (!ash_util::IsRunningInMash()) | 730 if (!IsRunningInMash()) |
731 finalize_animation_type_ = ANIMATION_WORKSPACE; | 731 finalize_animation_type_ = ANIMATION_WORKSPACE; |
732 | 732 |
733 PrewarmAuthentication(); | 733 PrewarmAuthentication(); |
734 | 734 |
735 if (waiting_for_wallpaper_load_ && !initialize_webui_hidden_) { | 735 if (waiting_for_wallpaper_load_ && !initialize_webui_hidden_) { |
736 VLOG(1) << "Login WebUI >> sign in postponed"; | 736 VLOG(1) << "Login WebUI >> sign in postponed"; |
737 return; | 737 return; |
738 } | 738 } |
739 VLOG(1) << "Login WebUI >> sign in"; | 739 VLOG(1) << "Login WebUI >> sign in"; |
740 | 740 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 bool device_disabled = false; | 847 bool device_disabled = false; |
848 CrosSettings::Get()->GetBoolean(kDeviceDisabled, &device_disabled); | 848 CrosSettings::Get()->GetBoolean(kDeviceDisabled, &device_disabled); |
849 if (device_disabled && system::DeviceDisablingManager:: | 849 if (device_disabled && system::DeviceDisablingManager:: |
850 HonorDeviceDisablingDuringNormalOperation()) { | 850 HonorDeviceDisablingDuringNormalOperation()) { |
851 // If the device is disabled, bail out. A device disabled screen will be | 851 // If the device is disabled, bail out. A device disabled screen will be |
852 // shown by the DeviceDisablingManager. | 852 // shown by the DeviceDisablingManager. |
853 return; | 853 return; |
854 } | 854 } |
855 | 855 |
856 // Animation is not supported in Mash. | 856 // Animation is not supported in Mash. |
857 if (!ash_util::IsRunningInMash()) | 857 if (!IsRunningInMash()) |
858 finalize_animation_type_ = ANIMATION_FADE_OUT; | 858 finalize_animation_type_ = ANIMATION_FADE_OUT; |
859 if (!login_window_) | 859 if (!login_window_) |
860 LoadURL(GURL(kAppLaunchSplashURL)); | 860 LoadURL(GURL(kAppLaunchSplashURL)); |
861 | 861 |
862 login_view_->set_should_emit_login_prompt_visible(false); | 862 login_view_->set_should_emit_login_prompt_visible(false); |
863 | 863 |
864 app_launch_controller_.reset(new AppLaunchController( | 864 app_launch_controller_.reset(new AppLaunchController( |
865 app_id, diagnostic_mode, this, GetOobeUI())); | 865 app_id, diagnostic_mode, this, GetOobeUI())); |
866 | 866 |
867 app_launch_controller_->StartAppLaunch(auto_launch); | 867 app_launch_controller_->StartAppLaunch(auto_launch); |
868 } | 868 } |
869 | 869 |
870 void LoginDisplayHostImpl::StartArcKiosk(const AccountId& account_id) { | 870 void LoginDisplayHostImpl::StartArcKiosk(const AccountId& account_id) { |
871 VLOG(1) << "Login WebUI >> start ARC kiosk."; | 871 VLOG(1) << "Login WebUI >> start ARC kiosk."; |
872 SetStatusAreaVisible(false); | 872 SetStatusAreaVisible(false); |
873 | 873 |
874 // Animation is not supported in Mash. | 874 // Animation is not supported in Mash. |
875 if (!ash_util::IsRunningInMash()) | 875 if (!IsRunningInMash()) |
876 finalize_animation_type_ = ANIMATION_FADE_OUT; | 876 finalize_animation_type_ = ANIMATION_FADE_OUT; |
877 if (!login_window_) { | 877 if (!login_window_) { |
878 LoadURL(GURL(kAppLaunchSplashURL)); | 878 LoadURL(GURL(kAppLaunchSplashURL)); |
879 LoadURL(GURL(kArcKioskSplashURL)); | 879 LoadURL(GURL(kArcKioskSplashURL)); |
880 } | 880 } |
881 | 881 |
882 login_view_->set_should_emit_login_prompt_visible(false); | 882 login_view_->set_should_emit_login_prompt_visible(false); |
883 | 883 |
884 arc_kiosk_controller_ = | 884 arc_kiosk_controller_ = |
885 base::MakeUnique<ArcKioskController>(this, GetOobeUI()); | 885 base::MakeUnique<ArcKioskController>(this, GetOobeUI()); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 // example) are ignored. | 938 // example) are ignored. |
939 OnBrowserCreated(); | 939 OnBrowserCreated(); |
940 registrar_.Remove(this, | 940 registrar_.Remove(this, |
941 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, | 941 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
942 content::NotificationService::AllSources()); | 942 content::NotificationService::AllSources()); |
943 registrar_.Remove(this, | 943 registrar_.Remove(this, |
944 chrome::NOTIFICATION_BROWSER_OPENED, | 944 chrome::NOTIFICATION_BROWSER_OPENED, |
945 content::NotificationService::AllSources()); | 945 content::NotificationService::AllSources()); |
946 } else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED && | 946 } else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED && |
947 user_manager::UserManager::Get()->IsCurrentUserNew()) { | 947 user_manager::UserManager::Get()->IsCurrentUserNew()) { |
948 if (!ash_util::IsRunningInMash()) { | 948 if (!IsRunningInMash()) { |
949 // For new user, move wallpaper to lock container so that windows created | 949 // For new user, move wallpaper to lock container so that windows created |
950 // during the user image picker step are below it. | 950 // during the user image picker step are below it. |
951 ash::WmShell::Get()->wallpaper_controller()->MoveToLockedContainer(); | 951 ash::WmShell::Get()->wallpaper_controller()->MoveToLockedContainer(); |
952 } else { | 952 } else { |
953 NOTIMPLEMENTED(); | 953 NOTIMPLEMENTED(); |
954 } | 954 } |
955 registrar_.Remove(this, | 955 registrar_.Remove(this, |
956 chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 956 chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
957 content::NotificationService::AllSources()); | 957 content::NotificationService::AllSources()); |
958 } else if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) { | 958 } else if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) { |
959 VLOG(1) << "Login WebUI >> wp animation done"; | 959 VLOG(1) << "Login WebUI >> wp animation done"; |
960 is_wallpaper_loaded_ = true; | 960 is_wallpaper_loaded_ = true; |
961 if (!ash_util::IsRunningInMash()) { | 961 if (!IsRunningInMash()) { |
962 ash::WmShell::Get() | 962 ash::WmShell::Get() |
963 ->wallpaper_delegate() | 963 ->wallpaper_delegate() |
964 ->OnWallpaperBootAnimationFinished(); | 964 ->OnWallpaperBootAnimationFinished(); |
965 } else { | 965 } else { |
966 NOTIMPLEMENTED(); | 966 NOTIMPLEMENTED(); |
967 } | 967 } |
968 if (waiting_for_wallpaper_load_) { | 968 if (waiting_for_wallpaper_load_) { |
969 // StartWizard / StartSignInScreen could be called multiple times through | 969 // StartWizard / StartSignInScreen could be called multiple times through |
970 // the lifetime of host. | 970 // the lifetime of host. |
971 // Make sure that subsequent calls are not postponed. | 971 // Make sure that subsequent calls are not postponed. |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1110 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); | 1110 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); |
1111 if (post_quit_task) | 1111 if (post_quit_task) |
1112 base::MessageLoop::current()->QuitWhenIdle(); | 1112 base::MessageLoop::current()->QuitWhenIdle(); |
1113 | 1113 |
1114 if (!completion_callback_.is_null()) | 1114 if (!completion_callback_.is_null()) |
1115 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 1115 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
1116 completion_callback_); | 1116 completion_callback_); |
1117 | 1117 |
1118 if (ash::Shell::HasInstance() && | 1118 if (ash::Shell::HasInstance() && |
1119 finalize_animation_type_ == ANIMATION_ADD_USER) { | 1119 finalize_animation_type_ == ANIMATION_ADD_USER) { |
1120 if (!ash_util::IsRunningInMash()) { | 1120 if (!IsRunningInMash()) { |
1121 ash::WmShell::Get()->wallpaper_controller()->MoveToUnlockedContainer(); | 1121 ash::WmShell::Get()->wallpaper_controller()->MoveToUnlockedContainer(); |
1122 } else { | 1122 } else { |
1123 NOTIMPLEMENTED(); | 1123 NOTIMPLEMENTED(); |
1124 } | 1124 } |
1125 } | 1125 } |
1126 } | 1126 } |
1127 | 1127 |
1128 void LoginDisplayHostImpl::ScheduleWorkspaceAnimation() { | 1128 void LoginDisplayHostImpl::ScheduleWorkspaceAnimation() { |
1129 if (ash_util::IsRunningInMash()) { | 1129 if (IsRunningInMash()) { |
1130 NOTIMPLEMENTED(); | 1130 NOTIMPLEMENTED(); |
1131 return; | 1131 return; |
1132 } | 1132 } |
1133 if (ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), | 1133 if (ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), |
1134 ash::kShellWindowId_WallpaperContainer) | 1134 ash::kShellWindowId_WallpaperContainer) |
1135 ->children() | 1135 ->children() |
1136 .empty()) { | 1136 .empty()) { |
1137 // If there is no wallpaper window, don't perform any animation on the | 1137 // If there is no wallpaper window, don't perform any animation on the |
1138 // default and wallpaper layer because there is nothing behind it. | 1138 // default and wallpaper layer because there is nothing behind it. |
1139 return; | 1139 return; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 | 1229 |
1230 keyboard_driven_oobe_key_handler_.reset(new KeyboardDrivenOobeKeyHandler); | 1230 keyboard_driven_oobe_key_handler_.reset(new KeyboardDrivenOobeKeyHandler); |
1231 } | 1231 } |
1232 | 1232 |
1233 views::Widget::InitParams params( | 1233 views::Widget::InitParams params( |
1234 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 1234 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
1235 params.bounds = wallpaper_bounds(); | 1235 params.bounds = wallpaper_bounds(); |
1236 params.show_state = ui::SHOW_STATE_FULLSCREEN; | 1236 params.show_state = ui::SHOW_STATE_FULLSCREEN; |
1237 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 1237 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
1238 // The ash::Shell containers are not available in Mash | 1238 // The ash::Shell containers are not available in Mash |
1239 if (!ash_util::IsRunningInMash()) { | 1239 if (!IsRunningInMash()) { |
1240 params.parent = | 1240 params.parent = |
1241 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), | 1241 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), |
1242 ash::kShellWindowId_LockScreenContainer); | 1242 ash::kShellWindowId_LockScreenContainer); |
1243 } else { | 1243 } else { |
1244 using ui::mojom::WindowManager; | 1244 using ui::mojom::WindowManager; |
1245 params.mus_properties[WindowManager::kContainerId_InitProperty] = | 1245 params.mus_properties[WindowManager::kContainerId_InitProperty] = |
1246 mojo::ConvertTo<std::vector<uint8_t>>( | 1246 mojo::ConvertTo<std::vector<uint8_t>>( |
1247 ash::kShellWindowId_LockScreenContainer); | 1247 ash::kShellWindowId_LockScreenContainer); |
1248 } | 1248 } |
1249 login_window_ = new views::Widget; | 1249 login_window_ = new views::Widget; |
1250 params.delegate = login_window_delegate_ = | 1250 params.delegate = login_window_delegate_ = |
1251 new LoginWidgetDelegate(login_window_, this); | 1251 new LoginWidgetDelegate(login_window_, this); |
1252 login_window_->Init(params); | 1252 login_window_->Init(params); |
1253 | 1253 |
1254 login_view_ = new WebUILoginView(WebUILoginView::WebViewSettings()); | 1254 login_view_ = new WebUILoginView(WebUILoginView::WebViewSettings()); |
1255 login_view_->Init(); | 1255 login_view_->Init(); |
1256 if (login_view_->webui_visible()) | 1256 if (login_view_->webui_visible()) |
1257 OnLoginPromptVisible(); | 1257 OnLoginPromptVisible(); |
1258 | 1258 |
1259 // Animations are not available in Mash | 1259 // Animations are not available in Mash |
1260 if (!ash_util::IsRunningInMash()) { | 1260 if (!IsRunningInMash()) { |
1261 login_window_->SetVisibilityAnimationDuration( | 1261 login_window_->SetVisibilityAnimationDuration( |
1262 base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs)); | 1262 base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs)); |
1263 login_window_->SetVisibilityAnimationTransition( | 1263 login_window_->SetVisibilityAnimationTransition( |
1264 views::Widget::ANIMATE_HIDE); | 1264 views::Widget::ANIMATE_HIDE); |
1265 } | 1265 } |
1266 | 1266 |
1267 login_window_->AddRemovalsObserver(this); | 1267 login_window_->AddRemovalsObserver(this); |
1268 login_window_->SetContentsView(login_view_); | 1268 login_window_->SetContentsView(login_view_); |
1269 | 1269 |
1270 // If WebUI is initialized in hidden state, show it only if we're no | 1270 // If WebUI is initialized in hidden state, show it only if we're no |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1482 // Chrome locale. Otherwise it will be lost if Chrome restarts. | 1482 // Chrome locale. Otherwise it will be lost if Chrome restarts. |
1483 // Don't need to schedule pref save because setting initial local | 1483 // Don't need to schedule pref save because setting initial local |
1484 // will enforce preference saving. | 1484 // will enforce preference saving. |
1485 prefs->SetString(prefs::kApplicationLocale, locale); | 1485 prefs->SetString(prefs::kApplicationLocale, locale); |
1486 StartupUtils::SetInitialLocale(locale); | 1486 StartupUtils::SetInitialLocale(locale); |
1487 | 1487 |
1488 TriggerShowLoginWizardFinish(locale, std::move(data)); | 1488 TriggerShowLoginWizardFinish(locale, std::move(data)); |
1489 } | 1489 } |
1490 | 1490 |
1491 } // namespace chromeos | 1491 } // namespace chromeos |
OLD | NEW |