| 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/audio/sounds.h" | 10 #include "ash/audio/sounds.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 // Animation, and initializing hidden, are not currently supported for Mash. |
| 283 finalize_animation_type_ = ANIMATION_NONE; |
| 284 initialize_webui_hidden_ = false; |
| 285 } |
| 286 |
| 280 DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this); | 287 DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this); |
| 281 CrasAudioHandler::Get()->AddAudioObserver(this); | 288 CrasAudioHandler::Get()->AddAudioObserver(this); |
| 282 if (keyboard::KeyboardController::GetInstance()) { | 289 if (keyboard::KeyboardController::GetInstance()) { |
| 283 keyboard::KeyboardController::GetInstance()->AddObserver(this); | 290 keyboard::KeyboardController::GetInstance()->AddObserver(this); |
| 284 is_observing_keyboard_ = true; | 291 is_observing_keyboard_ = true; |
| 285 } | 292 } |
| 286 | 293 |
| 287 ash::Shell::GetInstance()->delegate()->AddVirtualKeyboardStateObserver(this); | 294 if (!chrome::IsRunningInMash()) { |
| 295 ash::Shell::GetInstance()->delegate()->AddVirtualKeyboardStateObserver( |
| 296 this); |
| 297 } else { |
| 298 NOTIMPLEMENTED(); |
| 299 } |
| 288 display::Screen::GetScreen()->AddObserver(this); | 300 display::Screen::GetScreen()->AddObserver(this); |
| 289 | 301 |
| 290 // We need to listen to CLOSE_ALL_BROWSERS_REQUEST but not APP_TERMINATING | 302 // 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 | 303 // 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 | 304 // ref-count. CLOSE_ALL_BROWSERS_REQUEST is safe here because there will be no |
| 293 // browser instance that will block the shutdown. | 305 // browser instance that will block the shutdown. |
| 294 registrar_.Add(this, | 306 registrar_.Add(this, |
| 295 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, | 307 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
| 296 content::NotificationService::AllSources()); | 308 content::NotificationService::AllSources()); |
| 297 | 309 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 309 | 321 |
| 310 DCHECK(default_host() == nullptr); | 322 DCHECK(default_host() == nullptr); |
| 311 default_host_ = this; | 323 default_host_ = this; |
| 312 | 324 |
| 313 keep_alive_.reset( | 325 keep_alive_.reset( |
| 314 new ScopedKeepAlive(KeepAliveOrigin::LOGIN_DISPLAY_HOST_IMPL, | 326 new ScopedKeepAlive(KeepAliveOrigin::LOGIN_DISPLAY_HOST_IMPL, |
| 315 KeepAliveRestartOption::DISABLED)); | 327 KeepAliveRestartOption::DISABLED)); |
| 316 | 328 |
| 317 bool is_registered = StartupUtils::IsDeviceRegistered(); | 329 bool is_registered = StartupUtils::IsDeviceRegistered(); |
| 318 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); | 330 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); |
| 331 // Mash always runs login screen with zero delay |
| 332 if (chrome::IsRunningInMash()) |
| 333 zero_delay_enabled = true; |
| 319 bool disable_boot_animation = | 334 bool disable_boot_animation = |
| 320 base::CommandLine::ForCurrentProcess()->HasSwitch( | 335 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 321 switches::kDisableBootAnimation); | 336 switches::kDisableBootAnimation); |
| 322 | 337 |
| 323 waiting_for_wallpaper_load_ = !zero_delay_enabled && | 338 waiting_for_wallpaper_load_ = !zero_delay_enabled && |
| 324 (!is_registered || !disable_boot_animation); | 339 (!is_registered || !disable_boot_animation); |
| 325 | 340 |
| 326 // For slower hardware we have boot animation disabled so | 341 // For slower hardware we have boot animation disabled so |
| 327 // we'll be initializing WebUI hidden, waiting for user pods to load and then | 342 // we'll be initializing WebUI hidden, waiting for user pods to load and then |
| 328 // show WebUI at once. | 343 // show WebUI at once. |
| 329 waiting_for_user_pods_ = !zero_delay_enabled && !waiting_for_wallpaper_load_; | 344 waiting_for_user_pods_ = !zero_delay_enabled && !waiting_for_wallpaper_load_; |
| 330 | 345 |
| 331 initialize_webui_hidden_ = | 346 // Initializing hidden is not supported in Mash |
| 332 kHiddenWebUIInitializationDefault && !zero_delay_enabled; | 347 if (!chrome::IsRunningInMash()) { |
| 348 initialize_webui_hidden_ = |
| 349 kHiddenWebUIInitializationDefault && !zero_delay_enabled; |
| 350 } |
| 333 | 351 |
| 334 // Check if WebUI init type is overriden. | 352 // Check if WebUI init type is overriden. Not supported in Mash. |
| 335 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 353 if (!chrome::IsRunningInMash() && |
| 354 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 336 switches::kAshWebUIInit)) { | 355 switches::kAshWebUIInit)) { |
| 337 const std::string override_type = | 356 const std::string override_type = |
| 338 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 357 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 339 switches::kAshWebUIInit); | 358 switches::kAshWebUIInit); |
| 340 if (override_type == kWebUIInitParallel) | 359 if (override_type == kWebUIInitParallel) |
| 341 initialize_webui_hidden_ = true; | 360 initialize_webui_hidden_ = true; |
| 342 else if (override_type == kWebUIInitPostpone) | 361 else if (override_type == kWebUIInitPostpone) |
| 343 initialize_webui_hidden_ = false; | 362 initialize_webui_hidden_ = false; |
| 344 } | 363 } |
| 345 | 364 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 370 << " wait_for_wp_load_: " << waiting_for_wallpaper_load_ | 389 << " wait_for_wp_load_: " << waiting_for_wallpaper_load_ |
| 371 << " wait_for_pods_: " << waiting_for_user_pods_ | 390 << " wait_for_pods_: " << waiting_for_user_pods_ |
| 372 << " init_webui_hidden_: " << initialize_webui_hidden_; | 391 << " init_webui_hidden_: " << initialize_webui_hidden_; |
| 373 | 392 |
| 374 media::SoundsManager* manager = media::SoundsManager::Get(); | 393 media::SoundsManager* manager = media::SoundsManager::Get(); |
| 375 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 394 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
| 376 manager->Initialize(chromeos::SOUND_STARTUP, | 395 manager->Initialize(chromeos::SOUND_STARTUP, |
| 377 bundle.GetRawDataResource(IDR_SOUND_STARTUP_WAV)); | 396 bundle.GetRawDataResource(IDR_SOUND_STARTUP_WAV)); |
| 378 | 397 |
| 379 // Disable Drag'n'Drop for the login session. | 398 // Disable Drag'n'Drop for the login session. |
| 380 scoped_drag_drop_disabler_.reset(new aura::client::ScopedDragDropDisabler( | 399 if (!chrome::IsRunningInMash()) { |
| 381 ash::Shell::GetPrimaryRootWindow())); | 400 scoped_drag_drop_disabler_.reset(new aura::client::ScopedDragDropDisabler( |
| 401 ash::Shell::GetPrimaryRootWindow())); |
| 402 } else { |
| 403 NOTIMPLEMENTED(); |
| 404 } |
| 382 } | 405 } |
| 383 | 406 |
| 384 LoginDisplayHostImpl::~LoginDisplayHostImpl() { | 407 LoginDisplayHostImpl::~LoginDisplayHostImpl() { |
| 385 DBusThreadManager::Get()->GetSessionManagerClient()->RemoveObserver(this); | 408 DBusThreadManager::Get()->GetSessionManagerClient()->RemoveObserver(this); |
| 386 CrasAudioHandler::Get()->RemoveAudioObserver(this); | 409 CrasAudioHandler::Get()->RemoveAudioObserver(this); |
| 387 if (keyboard::KeyboardController::GetInstance() && is_observing_keyboard_) { | 410 if (keyboard::KeyboardController::GetInstance() && is_observing_keyboard_) { |
| 388 keyboard::KeyboardController::GetInstance()->RemoveObserver(this); | 411 keyboard::KeyboardController::GetInstance()->RemoveObserver(this); |
| 389 is_observing_keyboard_ = false; | 412 is_observing_keyboard_ = false; |
| 390 } | 413 } |
| 391 | 414 |
| 392 ash::Shell::GetInstance()->delegate()-> | 415 if (!chrome::IsRunningInMash()) { |
| 393 RemoveVirtualKeyboardStateObserver(this); | 416 ash::Shell::GetInstance()->delegate()->RemoveVirtualKeyboardStateObserver( |
| 417 this); |
| 418 } else { |
| 419 NOTIMPLEMENTED(); |
| 420 } |
| 394 display::Screen::GetScreen()->RemoveObserver(this); | 421 display::Screen::GetScreen()->RemoveObserver(this); |
| 395 | 422 |
| 396 if (login_view_ && login_window_) | 423 if (login_view_ && login_window_) |
| 397 login_window_->RemoveRemovalsObserver(this); | 424 login_window_->RemoveRemovalsObserver(this); |
| 398 | 425 |
| 399 chrome::MultiUserWindowManager* window_manager = | 426 chrome::MultiUserWindowManager* window_manager = |
| 400 chrome::MultiUserWindowManager::GetInstance(); | 427 chrome::MultiUserWindowManager::GetInstance(); |
| 401 // MultiUserWindowManager instance might be null if no user is logged in - or | 428 // MultiUserWindowManager instance might be null if no user is logged in - or |
| 402 // in a unit test. | 429 // in a unit test. |
| 403 if (window_manager) | 430 if (window_manager) |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 AppLaunchController* LoginDisplayHostImpl::GetAppLaunchController() { | 571 AppLaunchController* LoginDisplayHostImpl::GetAppLaunchController() { |
| 545 return app_launch_controller_.get(); | 572 return app_launch_controller_.get(); |
| 546 } | 573 } |
| 547 | 574 |
| 548 void LoginDisplayHostImpl::StartUserAdding( | 575 void LoginDisplayHostImpl::StartUserAdding( |
| 549 const base::Closure& completion_callback) { | 576 const base::Closure& completion_callback) { |
| 550 DisableKeyboardOverscroll(); | 577 DisableKeyboardOverscroll(); |
| 551 | 578 |
| 552 restore_path_ = RESTORE_ADD_USER_INTO_SESSION; | 579 restore_path_ = RESTORE_ADD_USER_INTO_SESSION; |
| 553 completion_callback_ = completion_callback; | 580 completion_callback_ = completion_callback; |
| 554 finalize_animation_type_ = ANIMATION_ADD_USER; | 581 // Animation is not supported in Mash |
| 582 if (!chrome::IsRunningInMash()) |
| 583 finalize_animation_type_ = ANIMATION_ADD_USER; |
| 555 // Observe the user switch animation and defer the deletion of itself only | 584 // Observe the user switch animation and defer the deletion of itself only |
| 556 // after the animation is finished. | 585 // after the animation is finished. |
| 557 chrome::MultiUserWindowManager* window_manager = | 586 chrome::MultiUserWindowManager* window_manager = |
| 558 chrome::MultiUserWindowManager::GetInstance(); | 587 chrome::MultiUserWindowManager::GetInstance(); |
| 559 // MultiUserWindowManager instance might be null in a unit test. | 588 // MultiUserWindowManager instance might be null in a unit test. |
| 560 if (window_manager) | 589 if (window_manager) |
| 561 window_manager->AddObserver(this); | 590 window_manager->AddObserver(this); |
| 562 | 591 |
| 563 VLOG(1) << "Login WebUI >> user adding"; | 592 VLOG(1) << "Login WebUI >> user adding"; |
| 564 if (!login_window_) | 593 if (!login_window_) |
| 565 LoadURL(GURL(kUserAddingURL)); | 594 LoadURL(GURL(kUserAddingURL)); |
| 566 // We should emit this signal only at login screen (after reboot or sign out). | 595 // We should emit this signal only at login screen (after reboot or sign out). |
| 567 login_view_->set_should_emit_login_prompt_visible(false); | 596 login_view_->set_should_emit_login_prompt_visible(false); |
| 568 | 597 |
| 569 // Lock container can be transparent after lock screen animation. | 598 if (!chrome::IsRunningInMash()) { |
| 570 aura::Window* lock_container = ash::Shell::GetContainer( | 599 // Lock container can be transparent after lock screen animation. |
| 571 ash::Shell::GetPrimaryRootWindow(), | 600 aura::Window* lock_container = ash::Shell::GetContainer( |
| 572 ash::kShellWindowId_LockScreenContainersContainer); | 601 ash::Shell::GetPrimaryRootWindow(), |
| 573 lock_container->layer()->SetOpacity(1.0); | 602 ash::kShellWindowId_LockScreenContainersContainer); |
| 603 lock_container->layer()->SetOpacity(1.0); |
| 574 | 604 |
| 575 ash::Shell::GetInstance()-> | 605 ash::Shell::GetInstance() |
| 576 desktop_background_controller()->MoveDesktopToLockedContainer(); | 606 ->desktop_background_controller() |
| 607 ->MoveDesktopToLockedContainer(); |
| 608 } else { |
| 609 NOTIMPLEMENTED(); |
| 610 } |
| 577 | 611 |
| 578 existing_user_controller_.reset(); // Only one controller in a time. | 612 existing_user_controller_.reset(); // Only one controller in a time. |
| 579 existing_user_controller_.reset(new chromeos::ExistingUserController(this)); | 613 existing_user_controller_.reset(new chromeos::ExistingUserController(this)); |
| 580 | 614 |
| 581 if (!signin_screen_controller_.get()) { | 615 if (!signin_screen_controller_.get()) { |
| 582 signin_screen_controller_.reset(new SignInScreenController( | 616 signin_screen_controller_.reset(new SignInScreenController( |
| 583 GetOobeUI(), webui_login_display_->delegate())); | 617 GetOobeUI(), webui_login_display_->delegate())); |
| 584 } | 618 } |
| 585 | 619 |
| 586 SetOobeProgressBarVisible(oobe_progress_bar_visible_ = false); | 620 SetOobeProgressBarVisible(oobe_progress_bar_visible_ = false); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 604 | 638 |
| 605 void LoginDisplayHostImpl::StartSignInScreen( | 639 void LoginDisplayHostImpl::StartSignInScreen( |
| 606 const LoginScreenContext& context) { | 640 const LoginScreenContext& context) { |
| 607 DisableKeyboardOverscroll(); | 641 DisableKeyboardOverscroll(); |
| 608 | 642 |
| 609 startup_sound_honors_spoken_feedback_ = true; | 643 startup_sound_honors_spoken_feedback_ = true; |
| 610 TryToPlayStartupSound(); | 644 TryToPlayStartupSound(); |
| 611 | 645 |
| 612 restore_path_ = RESTORE_SIGN_IN; | 646 restore_path_ = RESTORE_SIGN_IN; |
| 613 is_showing_login_ = true; | 647 is_showing_login_ = true; |
| 614 finalize_animation_type_ = ANIMATION_WORKSPACE; | 648 // Animation is not supported in Mash |
| 649 if (!chrome::IsRunningInMash()) |
| 650 finalize_animation_type_ = ANIMATION_WORKSPACE; |
| 615 | 651 |
| 616 PrewarmAuthentication(); | 652 PrewarmAuthentication(); |
| 617 | 653 |
| 618 if (waiting_for_wallpaper_load_ && !initialize_webui_hidden_) { | 654 if (waiting_for_wallpaper_load_ && !initialize_webui_hidden_) { |
| 619 VLOG(1) << "Login WebUI >> sign in postponed"; | 655 VLOG(1) << "Login WebUI >> sign in postponed"; |
| 620 return; | 656 return; |
| 621 } | 657 } |
| 622 VLOG(1) << "Login WebUI >> sign in"; | 658 VLOG(1) << "Login WebUI >> sign in"; |
| 623 | 659 |
| 624 if (!login_window_) { | 660 if (!login_window_) { |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 | 765 |
| 730 bool device_disabled = false; | 766 bool device_disabled = false; |
| 731 CrosSettings::Get()->GetBoolean(kDeviceDisabled, &device_disabled); | 767 CrosSettings::Get()->GetBoolean(kDeviceDisabled, &device_disabled); |
| 732 if (device_disabled && system::DeviceDisablingManager:: | 768 if (device_disabled && system::DeviceDisablingManager:: |
| 733 HonorDeviceDisablingDuringNormalOperation()) { | 769 HonorDeviceDisablingDuringNormalOperation()) { |
| 734 // If the device is disabled, bail out. A device disabled screen will be | 770 // If the device is disabled, bail out. A device disabled screen will be |
| 735 // shown by the DeviceDisablingManager. | 771 // shown by the DeviceDisablingManager. |
| 736 return; | 772 return; |
| 737 } | 773 } |
| 738 | 774 |
| 739 finalize_animation_type_ = ANIMATION_FADE_OUT; | 775 // Animation is not supported in Mash. |
| 776 if (!chrome::IsRunningInMash()) |
| 777 finalize_animation_type_ = ANIMATION_FADE_OUT; |
| 740 if (!login_window_) | 778 if (!login_window_) |
| 741 LoadURL(GURL(kAppLaunchSplashURL)); | 779 LoadURL(GURL(kAppLaunchSplashURL)); |
| 742 | 780 |
| 743 login_view_->set_should_emit_login_prompt_visible(false); | 781 login_view_->set_should_emit_login_prompt_visible(false); |
| 744 | 782 |
| 745 app_launch_controller_.reset(new AppLaunchController( | 783 app_launch_controller_.reset(new AppLaunchController( |
| 746 app_id, diagnostic_mode, this, GetOobeUI())); | 784 app_id, diagnostic_mode, this, GetOobeUI())); |
| 747 | 785 |
| 748 app_launch_controller_->StartAppLaunch(auto_launch); | 786 app_launch_controller_->StartAppLaunch(auto_launch); |
| 749 } | 787 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 // example) are ignored. | 837 // example) are ignored. |
| 800 OnBrowserCreated(); | 838 OnBrowserCreated(); |
| 801 registrar_.Remove(this, | 839 registrar_.Remove(this, |
| 802 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, | 840 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
| 803 content::NotificationService::AllSources()); | 841 content::NotificationService::AllSources()); |
| 804 registrar_.Remove(this, | 842 registrar_.Remove(this, |
| 805 chrome::NOTIFICATION_BROWSER_OPENED, | 843 chrome::NOTIFICATION_BROWSER_OPENED, |
| 806 content::NotificationService::AllSources()); | 844 content::NotificationService::AllSources()); |
| 807 } else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED && | 845 } else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED && |
| 808 user_manager::UserManager::Get()->IsCurrentUserNew()) { | 846 user_manager::UserManager::Get()->IsCurrentUserNew()) { |
| 809 // For new user, move desktop to locker container so that windows created | 847 if (!chrome::IsRunningInMash()) { |
| 810 // during the user image picker step are below it. | 848 // For new user, move desktop to locker container so that windows created |
| 811 ash::Shell::GetInstance()-> | 849 // during the user image picker step are below it. |
| 812 desktop_background_controller()->MoveDesktopToLockedContainer(); | 850 ash::Shell::GetInstance() |
| 851 ->desktop_background_controller() |
| 852 ->MoveDesktopToLockedContainer(); |
| 853 } else { |
| 854 NOTIMPLEMENTED(); |
| 855 } |
| 813 registrar_.Remove(this, | 856 registrar_.Remove(this, |
| 814 chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 857 chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
| 815 content::NotificationService::AllSources()); | 858 content::NotificationService::AllSources()); |
| 816 } else if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) { | 859 } else if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) { |
| 817 VLOG(1) << "Login WebUI >> wp animation done"; | 860 VLOG(1) << "Login WebUI >> wp animation done"; |
| 818 is_wallpaper_loaded_ = true; | 861 is_wallpaper_loaded_ = true; |
| 819 ash::Shell::GetInstance()->user_wallpaper_delegate() | 862 if (!chrome::IsRunningInMash()) { |
| 820 ->OnWallpaperBootAnimationFinished(); | 863 ash::Shell::GetInstance() |
| 864 ->user_wallpaper_delegate() |
| 865 ->OnWallpaperBootAnimationFinished(); |
| 866 } else { |
| 867 NOTIMPLEMENTED(); |
| 868 } |
| 821 if (waiting_for_wallpaper_load_) { | 869 if (waiting_for_wallpaper_load_) { |
| 822 // StartWizard / StartSignInScreen could be called multiple times through | 870 // StartWizard / StartSignInScreen could be called multiple times through |
| 823 // the lifetime of host. | 871 // the lifetime of host. |
| 824 // Make sure that subsequent calls are not postponed. | 872 // Make sure that subsequent calls are not postponed. |
| 825 waiting_for_wallpaper_load_ = false; | 873 waiting_for_wallpaper_load_ = false; |
| 826 if (initialize_webui_hidden_) | 874 if (initialize_webui_hidden_) |
| 827 ShowWebUI(); | 875 ShowWebUI(); |
| 828 else | 876 else |
| 829 StartPostponedWebUI(); | 877 StartPostponedWebUI(); |
| 830 } | 878 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 shutting_down_ = true; | 1007 shutting_down_ = true; |
| 960 registrar_.RemoveAll(); | 1008 registrar_.RemoveAll(); |
| 961 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 1009 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 962 if (post_quit_task) | 1010 if (post_quit_task) |
| 963 base::MessageLoop::current()->QuitWhenIdle(); | 1011 base::MessageLoop::current()->QuitWhenIdle(); |
| 964 | 1012 |
| 965 if (!completion_callback_.is_null()) | 1013 if (!completion_callback_.is_null()) |
| 966 base::MessageLoop::current()->PostTask(FROM_HERE, completion_callback_); | 1014 base::MessageLoop::current()->PostTask(FROM_HERE, completion_callback_); |
| 967 | 1015 |
| 968 if (ash::Shell::HasInstance() && | 1016 if (ash::Shell::HasInstance() && |
| 969 finalize_animation_type_ == ANIMATION_ADD_USER) { | 1017 finalize_animation_type_ == ANIMATION_ADD_USER && |
| 1018 !chrome::IsRunningInMash()) { |
| 970 ash::Shell::GetInstance() | 1019 ash::Shell::GetInstance() |
| 971 ->desktop_background_controller() | 1020 ->desktop_background_controller() |
| 972 ->MoveDesktopToUnlockedContainer(); | 1021 ->MoveDesktopToUnlockedContainer(); |
| 1022 } else { |
| 1023 NOTIMPLEMENTED(); |
| 973 } | 1024 } |
| 974 } | 1025 } |
| 975 | 1026 |
| 976 void LoginDisplayHostImpl::ScheduleWorkspaceAnimation() { | 1027 void LoginDisplayHostImpl::ScheduleWorkspaceAnimation() { |
| 1028 if (chrome::IsRunningInMash()) { |
| 1029 NOTIMPLEMENTED(); |
| 1030 return; |
| 1031 } |
| 977 if (ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), | 1032 if (ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), |
| 978 ash::kShellWindowId_DesktopBackgroundContainer) | 1033 ash::kShellWindowId_DesktopBackgroundContainer) |
| 979 ->children() | 1034 ->children() |
| 980 .empty()) { | 1035 .empty()) { |
| 981 // If there is no background window, don't perform any animation on the | 1036 // If there is no background window, don't perform any animation on the |
| 982 // default and background layer because there is nothing behind it. | 1037 // default and background layer because there is nothing behind it. |
| 983 return; | 1038 return; |
| 984 } | 1039 } |
| 985 | 1040 |
| 986 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 1041 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 focus_ring_controller_->SetVisible(true); | 1127 focus_ring_controller_->SetVisible(true); |
| 1073 | 1128 |
| 1074 keyboard_driven_oobe_key_handler_.reset(new KeyboardDrivenOobeKeyHandler); | 1129 keyboard_driven_oobe_key_handler_.reset(new KeyboardDrivenOobeKeyHandler); |
| 1075 } | 1130 } |
| 1076 | 1131 |
| 1077 views::Widget::InitParams params( | 1132 views::Widget::InitParams params( |
| 1078 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 1133 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 1079 params.bounds = background_bounds(); | 1134 params.bounds = background_bounds(); |
| 1080 params.show_state = ui::SHOW_STATE_FULLSCREEN; | 1135 params.show_state = ui::SHOW_STATE_FULLSCREEN; |
| 1081 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 1136 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 1082 params.parent = | 1137 // The ash::Shell containers are not available in Mash |
| 1083 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), | 1138 if (!chrome::IsRunningInMash()) { |
| 1084 ash::kShellWindowId_LockScreenContainer); | 1139 params.parent = |
| 1140 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), |
| 1141 ash::kShellWindowId_LockScreenContainer); |
| 1142 } |
| 1085 login_window_ = new views::Widget; | 1143 login_window_ = new views::Widget; |
| 1086 params.delegate = new LoginWidgetDelegate(login_window_); | 1144 params.delegate = new LoginWidgetDelegate(login_window_); |
| 1087 login_window_->Init(params); | 1145 login_window_->Init(params); |
| 1088 | 1146 |
| 1089 login_view_ = new WebUILoginView(); | 1147 login_view_ = new WebUILoginView(); |
| 1090 login_view_->Init(); | 1148 login_view_->Init(); |
| 1091 if (login_view_->webui_visible()) | 1149 if (login_view_->webui_visible()) |
| 1092 OnLoginPromptVisible(); | 1150 OnLoginPromptVisible(); |
| 1093 | 1151 |
| 1094 login_window_->SetVisibilityAnimationDuration( | 1152 // Animations are not available in Mash |
| 1095 base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs)); | 1153 if (!chrome::IsRunningInMash()) { |
| 1096 login_window_->SetVisibilityAnimationTransition(views::Widget::ANIMATE_HIDE); | 1154 login_window_->SetVisibilityAnimationDuration( |
| 1155 base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs)); |
| 1156 login_window_->SetVisibilityAnimationTransition( |
| 1157 views::Widget::ANIMATE_HIDE); |
| 1158 } |
| 1097 | 1159 |
| 1098 login_window_->AddRemovalsObserver(this); | 1160 login_window_->AddRemovalsObserver(this); |
| 1099 login_window_->SetContentsView(login_view_); | 1161 login_window_->SetContentsView(login_view_); |
| 1100 | 1162 |
| 1101 // If WebUI is initialized in hidden state, show it only if we're no | 1163 // If WebUI is initialized in hidden state, show it only if we're no |
| 1102 // longer waiting for wallpaper animation/user images loading. Otherwise, | 1164 // longer waiting for wallpaper animation/user images loading. Otherwise, |
| 1103 // always show it. | 1165 // always show it. |
| 1104 if (!initialize_webui_hidden_ || | 1166 if (!initialize_webui_hidden_ || |
| 1105 (!waiting_for_wallpaper_load_ && !waiting_for_user_pods_)) { | 1167 (!waiting_for_wallpaper_load_ && !waiting_for_user_pods_)) { |
| 1106 VLOG(1) << "Login WebUI >> show login wnd on create"; | 1168 VLOG(1) << "Login WebUI >> show login wnd on create"; |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1307 | 1369 |
| 1308 locale_util::SwitchLanguageCallback callback( | 1370 locale_util::SwitchLanguageCallback callback( |
| 1309 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); | 1371 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); |
| 1310 | 1372 |
| 1311 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1373 // Load locale keyboards here. Hardware layout would be automatically enabled. |
| 1312 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, | 1374 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, |
| 1313 callback, ProfileManager::GetActiveUserProfile()); | 1375 callback, ProfileManager::GetActiveUserProfile()); |
| 1314 } | 1376 } |
| 1315 | 1377 |
| 1316 } // namespace chromeos | 1378 } // namespace chromeos |
| OLD | NEW |