Commit d742024d authored by Jacob Dufault's avatar Jacob Dufault Committed by Commit Bot

cros: Move keep_alive and drag'n'drop to LoginDisplayHostCommon.

- keep_alive ensures we do not exit/shutdown.
- drag'n'drop disables drag and drop.

Bug: 784495
Change-Id: I65525cf5065db48bc14db93af3f3b6e86bc715c7
Reviewed-on: https://chromium-review.googlesource.com/871835
Commit-Queue: Jacob Dufault <jdufault@chromium.org>
Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534836}
parent 8c3fa7b9
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
#include "chrome/browser/chromeos/login/ui/login_display_host_common.h" #include "chrome/browser/chromeos/login/ui/login_display_host_common.h"
#include "ash/shell.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/login/app_launch_controller.h" #include "chrome/browser/chromeos/login/app_launch_controller.h"
#include "chrome/browser/chromeos/login/arc_kiosk_controller.h" #include "chrome/browser/chromeos/login/arc_kiosk_controller.h"
#include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h"
...@@ -13,7 +15,12 @@ ...@@ -13,7 +15,12 @@
#include "chrome/browser/chromeos/mobile_config.h" #include "chrome/browser/chromeos/mobile_config.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/system/device_disabling_manager.h" #include "chrome/browser/chromeos/system/device_disabling_manager.h"
#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/ash/wallpaper_controller_client.h" #include "chrome/browser/ui/ash/wallpaper_controller_client.h"
#include "chrome/browser/ui/webui/chromeos/internet_detail_dialog.h"
#include "components/keep_alive_registry/keep_alive_types.h"
#include "components/keep_alive_registry/scoped_keep_alive.h"
#include "ui/wm/public/scoped_drag_drop_disabler.h"
namespace chromeos { namespace chromeos {
namespace { namespace {
...@@ -25,10 +32,36 @@ constexpr int64_t kPolicyServiceInitializationDelayMilliseconds = 100; ...@@ -25,10 +32,36 @@ constexpr int64_t kPolicyServiceInitializationDelayMilliseconds = 100;
} // namespace } // namespace
LoginDisplayHostCommon::LoginDisplayHostCommon() : weak_factory_(this) {} LoginDisplayHostCommon::LoginDisplayHostCommon() : weak_factory_(this) {
keep_alive_.reset(
new ScopedKeepAlive(KeepAliveOrigin::LOGIN_DISPLAY_HOST_WEBUI,
KeepAliveRestartOption::DISABLED));
// Disable Drag'n'Drop for the login session.
// ash::Shell may be null in tests.
if (ash::Shell::HasInstance() && !ash_util::IsRunningInMash()) {
scoped_drag_drop_disabler_.reset(
new wm::ScopedDragDropDisabler(ash::Shell::GetPrimaryRootWindow()));
} else {
NOTIMPLEMENTED();
}
// Close the login screen on NOTIFICATION_APP_TERMINATING.
registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING,
content::NotificationService::AllSources());
// NOTIFICATION_BROWSER_OPENED is issued after browser is created, but
// not shown yet. Lock window has to be closed at this point so that
// a browser window exists and the window can acquire input focus.
registrar_.Add(this, chrome::NOTIFICATION_BROWSER_OPENED,
content::NotificationService::AllSources());
}
LoginDisplayHostCommon::~LoginDisplayHostCommon() {} LoginDisplayHostCommon::~LoginDisplayHostCommon() {}
void LoginDisplayHostCommon::BeforeSessionStart() {
session_starting_ = true;
}
AppLaunchController* LoginDisplayHostCommon::GetAppLaunchController() { AppLaunchController* LoginDisplayHostCommon::GetAppLaunchController() {
return app_launch_controller_.get(); return app_launch_controller_.get();
} }
...@@ -127,10 +160,6 @@ void LoginDisplayHostCommon::StartArcKiosk(const AccountId& account_id) { ...@@ -127,10 +160,6 @@ void LoginDisplayHostCommon::StartArcKiosk(const AccountId& account_id) {
OnStartArcKiosk(); OnStartArcKiosk();
} }
void LoginDisplayHostCommon::OnAuthPrewarmDone() {
auth_prewarmer_.reset();
}
void LoginDisplayHostCommon::CompleteLogin(const UserContext& user_context) { void LoginDisplayHostCommon::CompleteLogin(const UserContext& user_context) {
ExistingUserController* controller = ExistingUserController* controller =
ExistingUserController::current_controller(); ExistingUserController::current_controller();
...@@ -177,4 +206,34 @@ bool LoginDisplayHostCommon::IsUserWhitelisted(const AccountId& account_id) { ...@@ -177,4 +206,34 @@ bool LoginDisplayHostCommon::IsUserWhitelisted(const AccountId& account_id) {
return controller->IsUserWhitelisted(account_id); return controller->IsUserWhitelisted(account_id);
} }
void LoginDisplayHostCommon::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
if (type == chrome::NOTIFICATION_APP_TERMINATING) {
ShutdownDisplayHost();
} else if (type == chrome::NOTIFICATION_BROWSER_OPENED && session_starting_) {
// Browsers created before session start (windows opened by extensions, for
// example) are ignored.
OnBrowserCreated();
registrar_.Remove(this, chrome::NOTIFICATION_APP_TERMINATING,
content::NotificationService::AllSources());
registrar_.Remove(this, chrome::NOTIFICATION_BROWSER_OPENED,
content::NotificationService::AllSources());
}
}
void LoginDisplayHostCommon::OnAuthPrewarmDone() {
auth_prewarmer_.reset();
}
void LoginDisplayHostCommon::ShutdownDisplayHost() {
if (shutting_down_)
return;
shutting_down_ = true;
registrar_.RemoveAll();
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
}
} // namespace chromeos } // namespace chromeos
...@@ -10,8 +10,14 @@ ...@@ -10,8 +10,14 @@
#include <vector> #include <vector>
#include "chrome/browser/chromeos/login/ui/login_display_host.h" #include "chrome/browser/chromeos/login/ui/login_display_host.h"
#include "content/public/browser/notification_observer.h"
class AccountId; class AccountId;
class ScopedKeepAlive;
namespace wm {
class ScopedDragDropDisabler;
}
namespace chromeos { namespace chromeos {
...@@ -21,12 +27,14 @@ class DemoAppLauncher; ...@@ -21,12 +27,14 @@ class DemoAppLauncher;
// LoginDisplayHostCommon contains code which is not specific to a particular UI // LoginDisplayHostCommon contains code which is not specific to a particular UI
// implementation - the goal is to reduce code duplication between // implementation - the goal is to reduce code duplication between
// LoginDisplayHostViews and LoginDisplayHostWebUI. // LoginDisplayHostViews and LoginDisplayHostWebUI.
class LoginDisplayHostCommon : public LoginDisplayHost { class LoginDisplayHostCommon : public LoginDisplayHost,
public content::NotificationObserver {
public: public:
LoginDisplayHostCommon(); LoginDisplayHostCommon();
~LoginDisplayHostCommon() override; ~LoginDisplayHostCommon() override;
// LoginDisplayHost: // LoginDisplayHost:
void BeforeSessionStart() final;
AppLaunchController* GetAppLaunchController() final; AppLaunchController* GetAppLaunchController() final;
void StartSignInScreen(const LoginScreenContext& context) final; void StartSignInScreen(const LoginScreenContext& context) final;
void PrewarmAuthentication() final; void PrewarmAuthentication() final;
...@@ -44,14 +52,23 @@ class LoginDisplayHostCommon : public LoginDisplayHost { ...@@ -44,14 +52,23 @@ class LoginDisplayHostCommon : public LoginDisplayHost {
void LoadSigninWallpaper() final; void LoadSigninWallpaper() final;
bool IsUserWhitelisted(const AccountId& account_id) final; bool IsUserWhitelisted(const AccountId& account_id) final;
// content::NotificationObserver:
void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
protected: protected:
virtual void OnStartSignInScreen(const LoginScreenContext& context) = 0; virtual void OnStartSignInScreen(const LoginScreenContext& context) = 0;
virtual void OnStartAppLaunch() = 0; virtual void OnStartAppLaunch() = 0;
virtual void OnStartArcKiosk() = 0; virtual void OnStartArcKiosk() = 0;
virtual void OnBrowserCreated() = 0;
// Deletes |auth_prewarmer_|. // Deletes |auth_prewarmer_|.
void OnAuthPrewarmDone(); void OnAuthPrewarmDone();
// Marks display host for deletion.
void ShutdownDisplayHost();
// Active instance of authentication prewarmer. // Active instance of authentication prewarmer.
std::unique_ptr<AuthPrewarmer> auth_prewarmer_; std::unique_ptr<AuthPrewarmer> auth_prewarmer_;
...@@ -64,7 +81,24 @@ class LoginDisplayHostCommon : public LoginDisplayHost { ...@@ -64,7 +81,24 @@ class LoginDisplayHostCommon : public LoginDisplayHost {
// ARC kiosk controller. // ARC kiosk controller.
std::unique_ptr<ArcKioskController> arc_kiosk_controller_; std::unique_ptr<ArcKioskController> arc_kiosk_controller_;
content::NotificationRegistrar registrar_;
private: private:
// True if session start is in progress.
bool session_starting_ = false;
// Has ShutdownDisplayHost() already been called? Used to avoid posting our
// own deletion to the message loop twice if the user logs out while we're
// still in the process of cleaning up after login (http://crbug.com/134463).
bool shutting_down_ = false;
// Make sure chrome won't exit while we are at login/oobe screen.
std::unique_ptr<ScopedKeepAlive> keep_alive_;
// Keeps a copy of the old Drag'n'Drop client, so that it would be disabled
// during a login session and restored afterwards.
std::unique_ptr<wm::ScopedDragDropDisabler> scoped_drag_drop_disabler_;
base::WeakPtrFactory<LoginDisplayHostCommon> weak_factory_; base::WeakPtrFactory<LoginDisplayHostCommon> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostCommon); DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostCommon);
......
...@@ -56,10 +56,6 @@ WebUILoginView* LoginDisplayHostViews::GetWebUILoginView() const { ...@@ -56,10 +56,6 @@ WebUILoginView* LoginDisplayHostViews::GetWebUILoginView() const {
return nullptr; return nullptr;
} }
void LoginDisplayHostViews::BeforeSessionStart() {
NOTIMPLEMENTED();
}
void LoginDisplayHostViews::Finalize(base::OnceClosure completion_callback) { void LoginDisplayHostViews::Finalize(base::OnceClosure completion_callback) {
completion_callbacks_.push_back(std::move(completion_callback)); completion_callbacks_.push_back(std::move(completion_callback));
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
...@@ -123,6 +119,10 @@ void LoginDisplayHostViews::OnStartArcKiosk() { ...@@ -123,6 +119,10 @@ void LoginDisplayHostViews::OnStartArcKiosk() {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
void LoginDisplayHostViews::OnBrowserCreated() {
NOTIMPLEMENTED();
}
void LoginDisplayHostViews::StartVoiceInteractionOobe() { void LoginDisplayHostViews::StartVoiceInteractionOobe() {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
......
...@@ -33,7 +33,6 @@ class LoginDisplayHostViews : public LoginDisplayHostCommon, ...@@ -33,7 +33,6 @@ class LoginDisplayHostViews : public LoginDisplayHostCommon,
gfx::NativeWindow GetNativeWindow() const override; gfx::NativeWindow GetNativeWindow() const override;
OobeUI* GetOobeUI() const override; OobeUI* GetOobeUI() const override;
WebUILoginView* GetWebUILoginView() const override; WebUILoginView* GetWebUILoginView() const override;
void BeforeSessionStart() override;
void Finalize(base::OnceClosure completion_callback) override; void Finalize(base::OnceClosure completion_callback) override;
void SetStatusAreaVisible(bool visible) override; void SetStatusAreaVisible(bool visible) override;
void StartWizard(OobeScreen first_screen) override; void StartWizard(OobeScreen first_screen) override;
...@@ -44,6 +43,7 @@ class LoginDisplayHostViews : public LoginDisplayHostCommon, ...@@ -44,6 +43,7 @@ class LoginDisplayHostViews : public LoginDisplayHostCommon,
void OnPreferencesChanged() override; void OnPreferencesChanged() override;
void OnStartAppLaunch() override; void OnStartAppLaunch() override;
void OnStartArcKiosk() override; void OnStartArcKiosk() override;
void OnBrowserCreated() override;
void StartVoiceInteractionOobe() override; void StartVoiceInteractionOobe() override;
bool IsVoiceInteractionOobe() override; bool IsVoiceInteractionOobe() override;
......
...@@ -72,8 +72,6 @@ ...@@ -72,8 +72,6 @@
#include "chromeos/settings/cros_settings_provider.h" #include "chromeos/settings/cros_settings_provider.h"
#include "chromeos/settings/timezone_settings.h" #include "chromeos/settings/timezone_settings.h"
#include "chromeos/timezone/timezone_resolver.h" #include "chromeos/timezone/timezone_resolver.h"
#include "components/keep_alive_registry/keep_alive_types.h"
#include "components/keep_alive_registry/scoped_keep_alive.h"
#include "components/language/core/common/locale_util.h" #include "components/language/core/common/locale_util.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/session_manager/core/session_manager.h" #include "components/session_manager/core/session_manager.h"
...@@ -434,24 +432,10 @@ LoginDisplayHostWebUI::LoginDisplayHostWebUI(const gfx::Rect& wallpaper_bounds) ...@@ -434,24 +432,10 @@ LoginDisplayHostWebUI::LoginDisplayHostWebUI(const gfx::Rect& wallpaper_bounds)
ui::InputDeviceManager::GetInstance()->AddObserver(this); ui::InputDeviceManager::GetInstance()->AddObserver(this);
// Close the login screen on NOTIFICATION_APP_TERMINATING.
registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING,
content::NotificationService::AllSources());
// NOTIFICATION_BROWSER_OPENED is issued after browser is created, but
// not shown yet. Lock window has to be closed at this point so that
// a browser window exists and the window can acquire input focus.
registrar_.Add(this, chrome::NOTIFICATION_BROWSER_OPENED,
content::NotificationService::AllSources());
// Login screen is moved to lock screen container when user logs in. // Login screen is moved to lock screen container when user logs in.
registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_CHANGED, registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_CHANGED,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
keep_alive_.reset(
new ScopedKeepAlive(KeepAliveOrigin::LOGIN_DISPLAY_HOST_WEBUI,
KeepAliveRestartOption::DISABLED));
bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); bool zero_delay_enabled = WizardController::IsZeroDelayEnabled();
// Mash always runs login screen with zero delay // Mash always runs login screen with zero delay
if (ash_util::IsRunningInMash()) if (ash_util::IsRunningInMash())
...@@ -505,14 +489,6 @@ LoginDisplayHostWebUI::LoginDisplayHostWebUI(const gfx::Rect& wallpaper_bounds) ...@@ -505,14 +489,6 @@ LoginDisplayHostWebUI::LoginDisplayHostWebUI(const gfx::Rect& wallpaper_bounds)
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
manager->Initialize(chromeos::SOUND_STARTUP, manager->Initialize(chromeos::SOUND_STARTUP,
bundle.GetRawDataResource(IDR_SOUND_STARTUP_WAV)); bundle.GetRawDataResource(IDR_SOUND_STARTUP_WAV));
// Disable Drag'n'Drop for the login session.
if (!ash_util::IsRunningInMash()) {
scoped_drag_drop_disabler_.reset(
new wm::ScopedDragDropDisabler(ash::Shell::GetPrimaryRootWindow()));
} else {
NOTIMPLEMENTED();
}
} }
LoginDisplayHostWebUI::~LoginDisplayHostWebUI() { LoginDisplayHostWebUI::~LoginDisplayHostWebUI() {
...@@ -542,8 +518,6 @@ LoginDisplayHostWebUI::~LoginDisplayHostWebUI() { ...@@ -542,8 +518,6 @@ LoginDisplayHostWebUI::~LoginDisplayHostWebUI() {
ScheduleCompletionCallbacks(std::move(completion_callbacks_)); ScheduleCompletionCallbacks(std::move(completion_callbacks_));
keep_alive_.reset();
// TODO(tengs): This should be refactored. See crbug.com/314934. // TODO(tengs): This should be refactored. See crbug.com/314934.
if (user_manager::UserManager::Get()->IsCurrentUserNew()) { if (user_manager::UserManager::Get()->IsCurrentUserNew()) {
// DriveOptInController will delete itself when finished. // DriveOptInController will delete itself when finished.
...@@ -569,10 +543,6 @@ WebUILoginView* LoginDisplayHostWebUI::GetWebUILoginView() const { ...@@ -569,10 +543,6 @@ WebUILoginView* LoginDisplayHostWebUI::GetWebUILoginView() const {
return login_view_; return login_view_;
} }
void LoginDisplayHostWebUI::BeforeSessionStart() {
session_starting_ = true;
}
void LoginDisplayHostWebUI::Finalize(base::OnceClosure completion_callback) { void LoginDisplayHostWebUI::Finalize(base::OnceClosure completion_callback) {
DVLOG(1) << "Finalizing LoginDisplayHost. User session starting"; DVLOG(1) << "Finalizing LoginDisplayHost. User session starting";
...@@ -816,6 +786,8 @@ void LoginDisplayHostWebUI::Observe( ...@@ -816,6 +786,8 @@ void LoginDisplayHostWebUI::Observe(
int type, int type,
const content::NotificationSource& source, const content::NotificationSource& source,
const content::NotificationDetails& details) { const content::NotificationDetails& details) {
LoginDisplayHostCommon::Observe(type, source, details);
if (chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE == type || if (chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE == type ||
chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN == type) { chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN == type) {
VLOG(1) << "Login WebUI >> WEBUI_VISIBLE"; VLOG(1) << "Login WebUI >> WEBUI_VISIBLE";
...@@ -828,16 +800,6 @@ void LoginDisplayHostWebUI::Observe( ...@@ -828,16 +800,6 @@ void LoginDisplayHostWebUI::Observe(
content::NotificationService::AllSources()); content::NotificationService::AllSources());
registrar_.Remove(this, chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN, registrar_.Remove(this, chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
} else if (type == chrome::NOTIFICATION_APP_TERMINATING) {
ShutdownDisplayHost();
} else if (type == chrome::NOTIFICATION_BROWSER_OPENED && session_starting_) {
// Browsers created before session start (windows opened by extensions, for
// example) are ignored.
OnBrowserCreated();
registrar_.Remove(this, chrome::NOTIFICATION_APP_TERMINATING,
content::NotificationService::AllSources());
registrar_.Remove(this, chrome::NOTIFICATION_BROWSER_OPENED,
content::NotificationService::AllSources());
} else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED && } else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED &&
user_manager::UserManager::Get()->IsCurrentUserNew()) { user_manager::UserManager::Get()->IsCurrentUserNew()) {
registrar_.Remove(this, chrome::NOTIFICATION_LOGIN_USER_CHANGED, registrar_.Remove(this, chrome::NOTIFICATION_LOGIN_USER_CHANGED,
...@@ -967,15 +929,6 @@ void LoginDisplayHostWebUI::OnUserSwitchAnimationFinished() { ...@@ -967,15 +929,6 @@ void LoginDisplayHostWebUI::OnUserSwitchAnimationFinished() {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// LoginDisplayHostWebUI, private // LoginDisplayHostWebUI, private
void LoginDisplayHostWebUI::ShutdownDisplayHost() {
if (shutting_down_)
return;
shutting_down_ = true;
registrar_.RemoveAll();
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
}
void LoginDisplayHostWebUI::ScheduleWorkspaceAnimation() { void LoginDisplayHostWebUI::ScheduleWorkspaceAnimation() {
if (ash_util::IsRunningInMash()) { if (ash_util::IsRunningInMash()) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
......
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
#include "ui/events/devices/input_device_event_observer.h" #include "ui/events/devices/input_device_event_observer.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
#include "ui/views/widget/widget_removals_observer.h" #include "ui/views/widget/widget_removals_observer.h"
#include "ui/wm/public/scoped_drag_drop_disabler.h"
class ScopedKeepAlive;
namespace ash { namespace ash {
class FocusRingController; class FocusRingController;
...@@ -45,7 +42,6 @@ class WebUILoginView; ...@@ -45,7 +42,6 @@ class WebUILoginView;
// An implementation class for OOBE/login WebUI screen host. // An implementation class for OOBE/login WebUI screen host.
// It encapsulates controllers, wallpaper integration and flow. // It encapsulates controllers, wallpaper integration and flow.
class LoginDisplayHostWebUI : public LoginDisplayHostCommon, class LoginDisplayHostWebUI : public LoginDisplayHostCommon,
public content::NotificationObserver,
public content::WebContentsObserver, public content::WebContentsObserver,
public chromeos::SessionManagerClient::Observer, public chromeos::SessionManagerClient::Observer,
public chromeos::CrasAudioHandler::AudioObserver, public chromeos::CrasAudioHandler::AudioObserver,
...@@ -62,7 +58,6 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon, ...@@ -62,7 +58,6 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon,
gfx::NativeWindow GetNativeWindow() const override; gfx::NativeWindow GetNativeWindow() const override;
OobeUI* GetOobeUI() const override; OobeUI* GetOobeUI() const override;
WebUILoginView* GetWebUILoginView() const override; WebUILoginView* GetWebUILoginView() const override;
void BeforeSessionStart() override;
void Finalize(base::OnceClosure completion_callback) override; void Finalize(base::OnceClosure completion_callback) override;
void SetStatusAreaVisible(bool visible) override; void SetStatusAreaVisible(bool visible) override;
void StartWizard(OobeScreen first_screen) override; void StartWizard(OobeScreen first_screen) override;
...@@ -75,13 +70,11 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon, ...@@ -75,13 +70,11 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon,
void OnStartArcKiosk() override; void OnStartArcKiosk() override;
bool IsVoiceInteractionOobe() override; bool IsVoiceInteractionOobe() override;
void StartVoiceInteractionOobe() override; void StartVoiceInteractionOobe() override;
void OnBrowserCreated() override;
// Creates WizardController instance. // Creates WizardController instance.
WizardController* CreateWizardController(); WizardController* CreateWizardController();
// Called when the first browser window is created, but before it's shown.
void OnBrowserCreated();
const gfx::Rect& wallpaper_bounds() const { return wallpaper_bounds_; } const gfx::Rect& wallpaper_bounds() const { return wallpaper_bounds_; }
// Trace id for ShowLoginWebUI event (since there exists at most one login // Trace id for ShowLoginWebUI event (since there exists at most one login
...@@ -96,32 +89,32 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon, ...@@ -96,32 +89,32 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon,
protected: protected:
class KeyboardDrivenOobeKeyHandler; class KeyboardDrivenOobeKeyHandler;
// content::NotificationObserver implementation: // LoginDisplayHost:
void Observe(int type, void Observe(int type,
const content::NotificationSource& source, const content::NotificationSource& source,
const content::NotificationDetails& details) override; const content::NotificationDetails& details) override;
// Overridden from content::WebContentsObserver: // content::WebContentsObserver:
void RenderProcessGone(base::TerminationStatus status) override; void RenderProcessGone(base::TerminationStatus status) override;
// Overridden from chromeos::SessionManagerClient::Observer: // chromeos::SessionManagerClient::Observer:
void EmitLoginPromptVisibleCalled() override; void EmitLoginPromptVisibleCalled() override;
// Overridden from chromeos::CrasAudioHandler::AudioObserver: // chromeos::CrasAudioHandler::AudioObserver:
void OnActiveOutputNodeChanged() override; void OnActiveOutputNodeChanged() override;
// Overridden from display::DisplayObserver: // display::DisplayObserver:
void OnDisplayAdded(const display::Display& new_display) override; void OnDisplayAdded(const display::Display& new_display) override;
void OnDisplayMetricsChanged(const display::Display& display, void OnDisplayMetricsChanged(const display::Display& display,
uint32_t changed_metrics) override; uint32_t changed_metrics) override;
// Overridden from ui::InputDeviceEventObserver // ui::InputDeviceEventObserver
void OnTouchscreenDeviceConfigurationChanged() override; void OnTouchscreenDeviceConfigurationChanged() override;
// Overridden from views::WidgetRemovalsObserver: // views::WidgetRemovalsObserver:
void OnWillRemoveView(views::Widget* widget, views::View* view) override; void OnWillRemoveView(views::Widget* widget, views::View* view) override;
// Overridden from chrome::MultiUserWindowManager::Observer: // chrome::MultiUserWindowManager::Observer:
void OnUserSwitchAnimationFinished() override; void OnUserSwitchAnimationFinished() override;
private: private:
...@@ -145,9 +138,6 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon, ...@@ -145,9 +138,6 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon,
// adding a user into multi-profile session. // adding a user into multi-profile session.
}; };
// Marks display host for deletion.
void ShutdownDisplayHost();
// Schedules workspace transition animation. // Schedules workspace transition animation.
void ScheduleWorkspaceAnimation(); void ScheduleWorkspaceAnimation();
...@@ -184,8 +174,6 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon, ...@@ -184,8 +174,6 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon,
// Used to calculate position of the screens and wallpaper. // Used to calculate position of the screens and wallpaper.
gfx::Rect wallpaper_bounds_; gfx::Rect wallpaper_bounds_;
content::NotificationRegistrar registrar_;
// Sign in screen controller. // Sign in screen controller.
std::unique_ptr<ExistingUserController> existing_user_controller_; std::unique_ptr<ExistingUserController> existing_user_controller_;
...@@ -194,20 +182,9 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon, ...@@ -194,20 +182,9 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon,
std::unique_ptr<SignInScreenController> signin_screen_controller_; std::unique_ptr<SignInScreenController> signin_screen_controller_;
// Make sure chrome won't exit while we are at login/oobe screen.
std::unique_ptr<ScopedKeepAlive> keep_alive_;
// Has ShutdownDisplayHost() already been called? Used to avoid posting our
// own deletion to the message loop twice if the user logs out while we're
// still in the process of cleaning up after login (http://crbug.com/134463).
bool shutting_down_ = false;
// Whether progress bar is shown on the OOBE page. // Whether progress bar is shown on the OOBE page.
bool oobe_progress_bar_visible_ = false; bool oobe_progress_bar_visible_ = false;
// True if session start is in progress.
bool session_starting_ = false;
// Container of the screen we are displaying. // Container of the screen we are displaying.
views::Widget* login_window_ = nullptr; views::Widget* login_window_ = nullptr;
...@@ -272,10 +249,6 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon, ...@@ -272,10 +249,6 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon,
// After OOBE is completed, this is always initialized with true. // After OOBE is completed, this is always initialized with true.
bool oobe_startup_sound_played_ = false; bool oobe_startup_sound_played_ = false;
// Keeps a copy of the old Drag'n'Drop client, so that it would be disabled
// during a login session and restored afterwards.
std::unique_ptr<wm::ScopedDragDropDisabler> scoped_drag_drop_disabler_;
bool is_voice_interaction_oobe_ = false; bool is_voice_interaction_oobe_ = false;
base::WeakPtrFactory<LoginDisplayHostWebUI> animation_weak_ptr_factory_; base::WeakPtrFactory<LoginDisplayHostWebUI> animation_weak_ptr_factory_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment