Chromium Code Reviews| Index: chrome/browser/chromeos/login/ui/login_display_host_impl.cc |
| diff --git a/chrome/browser/chromeos/login/ui/login_display_host_impl.cc b/chrome/browser/chromeos/login/ui/login_display_host_impl.cc |
| index 44c14bc0665b4b848c7a25a1fd81bfd5885206e2..253ac3a4384ff85ee52a39bdce088df1a75b5300 100644 |
| --- a/chrome/browser/chromeos/login/ui/login_display_host_impl.cc |
| +++ b/chrome/browser/chromeos/login/ui/login_display_host_impl.cc |
| @@ -96,6 +96,11 @@ |
| #include "ui/wm/core/window_animations.h" |
| #include "url/gurl.h" |
| +#if defined(USE_ATHENA) |
| +#include "athena/common/container_priorities.h" |
| +#include "athena/screen/public/screen_manager.h" |
| +#endif |
| + |
| namespace { |
| // Maximum delay for startup sound after 'loginPromptVisible' signal. |
| @@ -289,8 +294,11 @@ LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& background_bounds) |
| is_observing_keyboard_ = true; |
| } |
| - ash::Shell::GetInstance()->delegate()->AddVirtualKeyboardStateObserver(this); |
| - ash::Shell::GetScreen()->AddObserver(this); |
| + if (ash::Shell::HasInstance()) { |
| + ash::Shell::GetInstance()->delegate()-> |
| + AddVirtualKeyboardStateObserver(this); |
| + ash::Shell::GetScreen()->AddObserver(this); |
| + } |
| // We need to listen to CLOSE_ALL_BROWSERS_REQUEST but not APP_TERMINATING |
| // because/ APP_TERMINATING will never be fired as long as this keeps |
| @@ -326,6 +334,11 @@ LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& background_bounds) |
| waiting_for_wallpaper_load_ = !zero_delay_enabled && |
| (!is_registered || !disable_boot_animation); |
| +#if defined(USE_ATHENA) |
| + // Athena doesn't use wallpaper manager so don't wait for wallpaper loading. |
|
oshima
2014/09/04 16:14:28
I believe we want to use it, and if so, we should
bshe
2014/09/04 18:36:53
Right. I think eventually we want to support chang
Dmitry Polukhin
2014/09/05 15:05:00
Done.
|
| + waiting_for_wallpaper_load_ = false; |
| +#endif |
| + |
| // For slower hardware we have boot animation disabled so |
| // we'll be initializing WebUI hidden, waiting for user pods to load and then |
| // show WebUI at once. |
| @@ -391,9 +404,11 @@ LoginDisplayHostImpl::~LoginDisplayHostImpl() { |
| is_observing_keyboard_ = false; |
| } |
| - ash::Shell::GetInstance()->delegate()-> |
| - RemoveVirtualKeyboardStateObserver(this); |
| - ash::Shell::GetScreen()->RemoveObserver(this); |
| + if (ash::Shell::HasInstance()) { |
| + ash::Shell::GetInstance()->delegate()-> |
| + RemoveVirtualKeyboardStateObserver(this); |
| + ash::Shell::GetScreen()->RemoveObserver(this); |
| + } |
| if (login_view_ && login_window_) |
| login_window_->RemoveRemovalsObserver(this); |
| @@ -404,8 +419,10 @@ LoginDisplayHostImpl::~LoginDisplayHostImpl() { |
| views::FocusManager::set_arrow_key_traversal_enabled(false); |
| ResetLoginWindowAndView(); |
| +#if !defined(USE_ATHENA) |
| // Let chrome process exit after login/oobe screen if needed. |
| chrome::DecrementKeepAliveCount(); |
| +#endif |
| default_host_ = NULL; |
| // TODO(tengs): This should be refactored. See crbug.com/314934. |
| @@ -779,10 +796,12 @@ void LoginDisplayHostImpl::Observe( |
| content::NotificationService::AllSources()); |
| } else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED && |
| user_manager::UserManager::Get()->IsCurrentUserNew()) { |
| - // For new user, move desktop to locker container so that windows created |
| - // during the user image picker step are below it. |
| - ash::Shell::GetInstance()-> |
| - desktop_background_controller()->MoveDesktopToLockedContainer(); |
| + if (ash::Shell::HasInstance()) { |
| + // For new user, move desktop to locker container so that windows created |
| + // during the user image picker step are below it. |
| + ash::Shell::GetInstance()-> |
| + desktop_background_controller()->MoveDesktopToLockedContainer(); |
| + } |
| registrar_.Remove(this, |
| chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
| content::NotificationService::AllSources()); |
| @@ -1040,10 +1059,19 @@ void LoginDisplayHostImpl::InitLoginWindowAndView() { |
| params.bounds = background_bounds(); |
| params.show_state = ui::SHOW_STATE_FULLSCREEN; |
| params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| +#if defined(USE_ATHENA) |
| + // TODO(dpolukhin): find right place for login/lock screen container, |
| + // perhaps inside athena::SystemUI. |
| + athena::ScreenManager::ContainerParams container_params( |
| + "LoginScreen", athena::CP_LOGIN_SCREEN); |
| + container_params.can_activate_children = true; |
| + params.parent = athena::ScreenManager::Get()->CreateContainer( |
| + container_params); |
|
oshima
2014/09/04 16:14:28
this container should be deleted when exiting logi
Dmitry Polukhin
2014/09/08 09:10:45
Done.
Nikita (slow)
2014/09/08 09:53:17
Are there plans to have single place (like RootWin
|
| +#else |
| params.parent = |
| ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), |
| ash::kShellWindowId_LockScreenContainer); |
| - |
| +#endif |
| login_window_ = new views::Widget; |
| params.delegate = new LoginWidgetDelegate(login_window_); |
| login_window_->Init(params); |
| @@ -1145,6 +1173,7 @@ void ShowLoginWizard(const std::string& first_screen_name) { |
| VLOG(1) << "Showing OOBE screen: " << first_screen_name; |
| +#if !defined(USE_ATHENA) |
| chromeos::input_method::InputMethodManager* manager = |
| chromeos::input_method::InputMethodManager::Get(); |
| @@ -1164,6 +1193,7 @@ void ShowLoginWizard(const std::string& first_screen_name) { |
| system::InputDeviceSettings::Get()->SetNaturalScroll( |
| CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kNaturalScrollDefault)); |
| +#endif |
| gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); |
| @@ -1234,10 +1264,12 @@ void ShowLoginWizard(const std::string& first_screen_name) { |
| const std::string& layout = startup_manifest->keyboard_layout(); |
| VLOG(1) << "Initial locale: " << locale << "keyboard layout " << layout; |
| +#if !defined(USE_ATHENA) |
| // Determine keyboard layout from OEM customization (if provided) or |
| // initial locale and save it in preferences. |
| manager->GetActiveIMEState()->SetInputMethodLoginDefaultFromVPD(locale, |
| layout); |
| +#endif |
| if (!current_locale.empty() || locale.empty()) { |
| ShowLoginWizardFinish(first_screen_name, startup_manifest, display_host); |