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/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
| 11 #include "ash/common/wallpaper/wallpaper_controller.h" |
11 #include "ash/common/wallpaper/wallpaper_delegate.h" | 12 #include "ash/common/wallpaper/wallpaper_delegate.h" |
12 #include "ash/common/wm_shell.h" | 13 #include "ash/common/wm_shell.h" |
13 #include "ash/public/interfaces/container.mojom.h" | 14 #include "ash/public/interfaces/container.mojom.h" |
14 #include "ash/shell.h" | 15 #include "ash/shell.h" |
15 #include "ash/wallpaper/wallpaper_controller.h" | |
16 #include "base/bind.h" | 16 #include "base/bind.h" |
17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
18 #include "base/location.h" | 18 #include "base/location.h" |
19 #include "base/logging.h" | 19 #include "base/logging.h" |
20 #include "base/macros.h" | 20 #include "base/macros.h" |
21 #include "base/single_thread_task_runner.h" | 21 #include "base/single_thread_task_runner.h" |
22 #include "base/strings/string_split.h" | 22 #include "base/strings/string_split.h" |
23 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
24 #include "base/threading/thread_restrictions.h" | 24 #include "base/threading/thread_restrictions.h" |
25 #include "base/threading/thread_task_runner_handle.h" | 25 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 | 467 |
468 void LoginDisplayHostImpl::BeforeSessionStart() { | 468 void LoginDisplayHostImpl::BeforeSessionStart() { |
469 session_starting_ = true; | 469 session_starting_ = true; |
470 } | 470 } |
471 | 471 |
472 void LoginDisplayHostImpl::Finalize() { | 472 void LoginDisplayHostImpl::Finalize() { |
473 DVLOG(1) << "Session starting"; | 473 DVLOG(1) << "Session starting"; |
474 // When adding another user into the session, we defer the wallpaper's | 474 // When adding another user into the session, we defer the wallpaper's |
475 // animation in order to prevent the flashing of the previous user's windows. | 475 // animation in order to prevent the flashing of the previous user's windows. |
476 // See crbug.com/541864. | 476 // See crbug.com/541864. |
477 if (ash::Shell::HasInstance() && | 477 if (ash::WmShell::HasInstance() && |
478 finalize_animation_type_ != ANIMATION_ADD_USER) { | 478 finalize_animation_type_ != ANIMATION_ADD_USER) { |
479 ash::Shell::GetInstance() | 479 ash::WmShell::Get()->wallpaper_controller()->MoveToUnlockedContainer(); |
480 ->wallpaper_controller() | |
481 ->MoveToUnlockedContainer(); | |
482 } | 480 } |
483 if (wizard_controller_.get()) | 481 if (wizard_controller_.get()) |
484 wizard_controller_->OnSessionStart(); | 482 wizard_controller_->OnSessionStart(); |
485 | 483 |
486 switch (finalize_animation_type_) { | 484 switch (finalize_animation_type_) { |
487 case ANIMATION_NONE: | 485 case ANIMATION_NONE: |
488 ShutdownDisplayHost(false); | 486 ShutdownDisplayHost(false); |
489 break; | 487 break; |
490 case ANIMATION_WORKSPACE: | 488 case ANIMATION_WORKSPACE: |
491 if (ash::Shell::HasInstance()) | 489 if (ash::Shell::HasInstance()) |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 // We should emit this signal only at login screen (after reboot or sign out). | 594 // We should emit this signal only at login screen (after reboot or sign out). |
597 login_view_->set_should_emit_login_prompt_visible(false); | 595 login_view_->set_should_emit_login_prompt_visible(false); |
598 | 596 |
599 if (!chrome::IsRunningInMash()) { | 597 if (!chrome::IsRunningInMash()) { |
600 // Lock container can be transparent after lock screen animation. | 598 // Lock container can be transparent after lock screen animation. |
601 aura::Window* lock_container = ash::Shell::GetContainer( | 599 aura::Window* lock_container = ash::Shell::GetContainer( |
602 ash::Shell::GetPrimaryRootWindow(), | 600 ash::Shell::GetPrimaryRootWindow(), |
603 ash::kShellWindowId_LockScreenContainersContainer); | 601 ash::kShellWindowId_LockScreenContainersContainer); |
604 lock_container->layer()->SetOpacity(1.0); | 602 lock_container->layer()->SetOpacity(1.0); |
605 | 603 |
606 ash::Shell::GetInstance()->wallpaper_controller()->MoveToLockedContainer(); | 604 ash::WmShell::Get()->wallpaper_controller()->MoveToLockedContainer(); |
607 } else { | 605 } else { |
608 NOTIMPLEMENTED(); | 606 NOTIMPLEMENTED(); |
609 } | 607 } |
610 | 608 |
611 existing_user_controller_.reset(); // Only one controller in a time. | 609 existing_user_controller_.reset(); // Only one controller in a time. |
612 existing_user_controller_.reset(new chromeos::ExistingUserController(this)); | 610 existing_user_controller_.reset(new chromeos::ExistingUserController(this)); |
613 | 611 |
614 if (!signin_screen_controller_.get()) { | 612 if (!signin_screen_controller_.get()) { |
615 signin_screen_controller_.reset(new SignInScreenController( | 613 signin_screen_controller_.reset(new SignInScreenController( |
616 GetOobeUI(), webui_login_display_->delegate())); | 614 GetOobeUI(), webui_login_display_->delegate())); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, | 837 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
840 content::NotificationService::AllSources()); | 838 content::NotificationService::AllSources()); |
841 registrar_.Remove(this, | 839 registrar_.Remove(this, |
842 chrome::NOTIFICATION_BROWSER_OPENED, | 840 chrome::NOTIFICATION_BROWSER_OPENED, |
843 content::NotificationService::AllSources()); | 841 content::NotificationService::AllSources()); |
844 } else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED && | 842 } else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED && |
845 user_manager::UserManager::Get()->IsCurrentUserNew()) { | 843 user_manager::UserManager::Get()->IsCurrentUserNew()) { |
846 if (!chrome::IsRunningInMash()) { | 844 if (!chrome::IsRunningInMash()) { |
847 // For new user, move wallpaper to lock container so that windows created | 845 // For new user, move wallpaper to lock container so that windows created |
848 // during the user image picker step are below it. | 846 // during the user image picker step are below it. |
849 ash::Shell::GetInstance() | 847 ash::WmShell::Get()->wallpaper_controller()->MoveToLockedContainer(); |
850 ->wallpaper_controller() | |
851 ->MoveToLockedContainer(); | |
852 } else { | 848 } else { |
853 NOTIMPLEMENTED(); | 849 NOTIMPLEMENTED(); |
854 } | 850 } |
855 registrar_.Remove(this, | 851 registrar_.Remove(this, |
856 chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 852 chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
857 content::NotificationService::AllSources()); | 853 content::NotificationService::AllSources()); |
858 } else if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) { | 854 } else if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) { |
859 VLOG(1) << "Login WebUI >> wp animation done"; | 855 VLOG(1) << "Login WebUI >> wp animation done"; |
860 is_wallpaper_loaded_ = true; | 856 is_wallpaper_loaded_ = true; |
861 if (!chrome::IsRunningInMash()) { | 857 if (!chrome::IsRunningInMash()) { |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 if (post_quit_task) | 1000 if (post_quit_task) |
1005 base::MessageLoop::current()->QuitWhenIdle(); | 1001 base::MessageLoop::current()->QuitWhenIdle(); |
1006 | 1002 |
1007 if (!completion_callback_.is_null()) | 1003 if (!completion_callback_.is_null()) |
1008 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 1004 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
1009 completion_callback_); | 1005 completion_callback_); |
1010 | 1006 |
1011 if (ash::Shell::HasInstance() && | 1007 if (ash::Shell::HasInstance() && |
1012 finalize_animation_type_ == ANIMATION_ADD_USER) { | 1008 finalize_animation_type_ == ANIMATION_ADD_USER) { |
1013 if (!chrome::IsRunningInMash()) { | 1009 if (!chrome::IsRunningInMash()) { |
1014 ash::Shell::GetInstance() | 1010 ash::WmShell::Get()->wallpaper_controller()->MoveToUnlockedContainer(); |
1015 ->wallpaper_controller() | |
1016 ->MoveToUnlockedContainer(); | |
1017 } else { | 1011 } else { |
1018 NOTIMPLEMENTED(); | 1012 NOTIMPLEMENTED(); |
1019 } | 1013 } |
1020 } | 1014 } |
1021 } | 1015 } |
1022 | 1016 |
1023 void LoginDisplayHostImpl::ScheduleWorkspaceAnimation() { | 1017 void LoginDisplayHostImpl::ScheduleWorkspaceAnimation() { |
1024 if (chrome::IsRunningInMash()) { | 1018 if (chrome::IsRunningInMash()) { |
1025 NOTIMPLEMENTED(); | 1019 NOTIMPLEMENTED(); |
1026 return; | 1020 return; |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 | 1364 |
1371 locale_util::SwitchLanguageCallback callback( | 1365 locale_util::SwitchLanguageCallback callback( |
1372 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); | 1366 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); |
1373 | 1367 |
1374 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1368 // Load locale keyboards here. Hardware layout would be automatically enabled. |
1375 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, | 1369 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, |
1376 callback, ProfileManager::GetActiveUserProfile()); | 1370 callback, ProfileManager::GetActiveUserProfile()); |
1377 } | 1371 } |
1378 | 1372 |
1379 } // namespace chromeos | 1373 } // namespace chromeos |
OLD | NEW |