#include <vector>
-#include "ash/audio/sounds.h"
-#include "ash/desktop_background/desktop_background_controller.h"
-#include "ash/desktop_background/user_wallpaper_delegate.h"
-#include "ash/shell.h"
-#include "ash/shell_window_ids.h"
#include "base/bind.h"
#include "base/command_line.h"
#include "base/debug/trace_event.h"
#include "chrome/browser/chromeos/login/screens/core_oobe_actor.h"
#include "chrome/browser/chromeos/login/startup_utils.h"
#include "chrome/browser/chromeos/login/ui/input_events_blocker.h"
-#include "chrome/browser/chromeos/login/ui/keyboard_driven_oobe_key_handler.h"
#include "chrome/browser/chromeos/login/ui/oobe_display.h"
#include "chrome/browser/chromeos/login/ui/webui_login_display.h"
#include "chrome/browser/chromeos/login/ui/webui_login_view.h"
#include "ui/views/focus/focus_manager.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
-#include "ui/wm/core/window_animations.h"
#include "url/gurl.h"
+#if !defined(USE_ATHENA)
+#include "ash/audio/sounds.h"
+#include "ash/desktop_background/desktop_background_controller.h"
+#include "ash/desktop_background/user_wallpaper_delegate.h"
+#include "ash/shell.h"
+#include "ash/shell_window_ids.h"
+#include "chrome/browser/chromeos/login/ui/keyboard_driven_oobe_key_handler.h"
+#endif
+
#if defined(USE_ATHENA)
#include "athena/screen/public/screen_manager.h"
#include "athena/util/container_priorities.h"
+#include "athena/util/fill_layout_manager.h"
#endif
namespace {
private:
// ui::ImplicitAnimationObserver implementation:
- virtual void OnImplicitAnimationsCompleted() OVERRIDE {
+ virtual void OnImplicitAnimationsCompleted() override {
callback_.Run();
delete this;
}
virtual ~LoginWidgetDelegate() {}
// Overridden from WidgetDelegate:
- virtual void DeleteDelegate() OVERRIDE {
+ virtual void DeleteDelegate() override {
delete this;
}
- virtual views::Widget* GetWidget() OVERRIDE {
+ virtual views::Widget* GetWidget() override {
return widget_;
}
- virtual const views::Widget* GetWidget() const OVERRIDE {
+ virtual const views::Widget* GetWidget() const override {
return widget_;
}
- virtual bool CanActivate() const OVERRIDE {
+ virtual bool CanActivate() const override {
return true;
}
- virtual bool ShouldAdvanceFocusToTopLevelWidget() const OVERRIDE {
+ virtual bool ShouldAdvanceFocusToTopLevelWidget() const override {
return true;
}
if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled())
initialize_webui_hidden_ = false;
+#if !defined(USE_ATHENA)
if (waiting_for_wallpaper_load_) {
registrar_.Add(this,
chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED,
content::NotificationService::AllSources());
}
+#endif
// When we wait for WebUI to be initialized we wait for one of
// these notifications.
void LoginDisplayHostImpl::Finalize() {
DVLOG(1) << "Session starting";
+#if !defined(USE_ATHENA)
if (ash::Shell::HasInstance()) {
ash::Shell::GetInstance()->
desktop_background_controller()->MoveDesktopToUnlockedContainer();
}
+#endif
if (wizard_controller_.get())
wizard_controller_->OnSessionStart();
ShutdownDisplayHost(false);
break;
case ANIMATION_WORKSPACE:
+#if !defined(USE_ATHENA)
if (ash::Shell::HasInstance())
ScheduleWorkspaceAnimation();
+#endif
ShutdownDisplayHost(false);
break;
// Keep parameters to restore if renderer crashes.
restore_path_ = RESTORE_WIZARD;
- wizard_first_screen_name_ = first_screen_name;
+ first_screen_name_ = first_screen_name;
if (screen_parameters.get())
- wizard_screen_parameters_.reset(screen_parameters->DeepCopy());
+ screen_parameters_.reset(screen_parameters->DeepCopy());
else
- wizard_screen_parameters_.reset();
+ screen_parameters_.reset();
is_showing_login_ = false;
if (waiting_for_wallpaper_load_ && !initialize_webui_hidden_) {
// We should emit this signal only at login screen (after reboot or sign out).
login_view_->set_should_emit_login_prompt_visible(false);
+#if !defined(USE_ATHENA)
// Lock container can be transparent after lock screen animation.
aura::Window* lock_container = ash::Shell::GetContainer(
ash::Shell::GetPrimaryRootWindow(),
ash::Shell::GetInstance()->
desktop_background_controller()->MoveDesktopToLockedContainer();
+#endif
sign_in_controller_.reset(); // Only one controller in a time.
sign_in_controller_.reset(new chromeos::ExistingUserController(this));
SetOobeProgressBarVisible(oobe_progress_bar_visible_ = false);
SetStatusAreaVisible(true);
sign_in_controller_->Init(
- user_manager::UserManager::Get()->GetUsersAdmittedForMultiProfile());
+ user_manager::UserManager::Get()->GetUsersAllowedForMultiProfile());
CHECK(webui_login_display_);
GetOobeUI()->ShowSigninScreen(LoginScreenContext(),
webui_login_display_,
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) {
- VLOG(1) << "Login WebUI >> wp animation done";
- is_wallpaper_loaded_ = true;
- ash::Shell::GetInstance()->user_wallpaper_delegate()
- ->OnWallpaperBootAnimationFinished();
- if (waiting_for_wallpaper_load_) {
- // StartWizard / StartSignInScreen could be called multiple times through
- // the lifetime of host.
- // Make sure that subsequent calls are not postponed.
- waiting_for_wallpaper_load_ = false;
- if (initialize_webui_hidden_)
- ShowWebUI();
- else
- StartPostponedWebUI();
- }
- registrar_.Remove(this,
- chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED,
- content::NotificationService::AllSources());
- } else if (chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE == type ||
- chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN == type) {
+ if (chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE == type ||
+ chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN == type) {
VLOG(1) << "Login WebUI >> WEBUI_VISIBLE";
if (waiting_for_user_pods_ && initialize_webui_hidden_) {
waiting_for_user_pods_ = false;
registrar_.Remove(this,
chrome::NOTIFICATION_LOGIN_USER_CHANGED,
content::NotificationService::AllSources());
+#if !defined(USE_ATHENA)
+ } else if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) {
+ VLOG(1) << "Login WebUI >> wp animation done";
+ is_wallpaper_loaded_ = true;
+ ash::Shell::GetInstance()->user_wallpaper_delegate()
+ ->OnWallpaperBootAnimationFinished();
+ if (waiting_for_wallpaper_load_) {
+ // StartWizard / StartSignInScreen could be called multiple times through
+ // the lifetime of host.
+ // Make sure that subsequent calls are not postponed.
+ waiting_for_wallpaper_load_ = false;
+ if (initialize_webui_hidden_)
+ ShowWebUI();
+ else
+ StartPostponedWebUI();
+ }
+ registrar_.Remove(this,
+ chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED,
+ content::NotificationService::AllSources());
+#endif
}
}
TryToPlayStartupSound();
}
+#if !defined(USE_ATHENA)
////////////////////////////////////////////////////////////////////////////////
// LoginDisplayHostImpl, ash::KeyboardStateObserver:
// implementation:
}
}
}
+#endif
////////////////////////////////////////////////////////////////////////////////
// LoginDisplayHostImpl, keyboard::KeyboardControllerObserver:
void LoginDisplayHostImpl::OnDisplayMetricsChanged(const gfx::Display& display,
uint32_t changed_metrics) {
- if (display.id() != ash::Shell::GetScreen()->GetPrimaryDisplay().id() ||
+ gfx::Display primary_display =
+ gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
+ if (display.id() != primary_display.id() ||
!(changed_metrics & DISPLAY_METRIC_BOUNDS)) {
return;
}
if (GetOobeUI()) {
- const gfx::Size& size = ash::Shell::GetScreen()->GetPrimaryDisplay().size();
+ const gfx::Size& size = primary_display.size();
GetOobeUI()->GetCoreOobeActor()->SetClientAreaSize(size.width(),
size.height());
}
}
void LoginDisplayHostImpl::ScheduleWorkspaceAnimation() {
+#if !defined(USE_ATHENA)
if (ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
ash::kShellWindowId_DesktopBackgroundContainer)
->children()
if (!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableLoginAnimations))
ash::Shell::GetInstance()->DoInitialWorkspaceAnimation();
+#endif
}
void LoginDisplayHostImpl::ScheduleFadeOutAnimation() {
switch (restore_path_) {
case RESTORE_WIZARD:
- StartWizard(wizard_first_screen_name_,
- wizard_screen_parameters_.Pass());
+ StartWizard(first_screen_name_, screen_parameters_.Pass());
break;
case RESTORE_SIGN_IN:
StartSignInScreen(LoginScreenContext());
// crbug.com/405859
focus_ring_controller_.reset(new FocusRingController);
focus_ring_controller_->SetVisible(true);
-#endif
keyboard_driven_oobe_key_handler_.reset(new KeyboardDrivenOobeKeyHandler);
+#endif
}
views::Widget::InitParams params(
athena::ScreenManager::ContainerParams container_params(
"LoginScreen", athena::CP_LOGIN_SCREEN);
container_params.can_activate_children = true;
+ container_params.block_events = true;
+ container_params.modal_container_priority =
+ athena::CP_LOGIN_SCREEN_SYSTEM_MODAL;
login_screen_container_.reset(
athena::ScreenManager::Get()->CreateContainer(container_params));
params.parent = login_screen_container_.get();
+ login_screen_container_->SetLayoutManager(
+ new athena::FillLayoutManager(login_screen_container_.get()));
#else
params.parent =
ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
if (login_view_->webui_visible())
OnLoginPromptVisible();
- wm::SetWindowVisibilityAnimationDuration(
- login_window_->GetNativeView(),
+ login_window_->SetVisibilityAnimationDuration(
base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs));
- wm::SetWindowVisibilityAnimationTransition(
- login_window_->GetNativeView(),
- wm::ANIMATE_HIDE);
+ login_window_->SetVisibilityAnimationTransition(views::Widget::ANIMATE_HIDE);
login_window_->AddRemovalsObserver(this);
login_window_->SetContentsView(login_view_);
return;
login_window_->Close();
login_window_ = NULL;
+
+ if (!login_view_)
+ return;
+ login_view_->SetUIEnabled(true);
login_view_ = NULL;
}
return;
}
+#if !defined(USE_ATHENA)
if (!startup_sound_honors_spoken_feedback_ &&
!ash::PlaySystemSoundAlways(SOUND_STARTUP)) {
EnableSystemSoundsForAccessibility();
return;
}
-#if !defined(USE_ATHENA)
// crbug.com/408733
if (startup_sound_honors_spoken_feedback_ &&
!ash::PlaySystemSoundIfSpokenFeedback(SOUND_STARTUP)) {