| Index: chrome/browser/chromeos/login/login_display_host_impl.h
|
| diff --git a/chrome/browser/chromeos/login/login_display_host_impl.h b/chrome/browser/chromeos/login/login_display_host_impl.h
|
| index f2be863896fe8616dc0543ae3c93a93d8b076fff..162a9461926f1c8688353863f8a4940d916085c8 100644
|
| --- a/chrome/browser/chromeos/login/login_display_host_impl.h
|
| +++ b/chrome/browser/chromeos/login/login_display_host_impl.h
|
| @@ -10,11 +10,14 @@
|
| #include "base/compiler_specific.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/memory/weak_ptr.h"
|
| +#include "chrome/browser/chromeos/login/existing_user_controller.h"
|
| #include "chrome/browser/chromeos/login/login_display.h"
|
| #include "chrome/browser/chromeos/login/login_display_host.h"
|
| +#include "chrome/browser/chromeos/login/wizard_controller.h"
|
| #include "chrome/browser/chromeos/settings/device_settings_service.h"
|
| #include "content/public/browser/notification_observer.h"
|
| #include "content/public/browser/notification_registrar.h"
|
| +#include "content/public/browser/web_contents_observer.h"
|
| #include "ui/gfx/rect.h"
|
|
|
| class PrefService;
|
| @@ -25,13 +28,15 @@ class AutoEnrollmentClient;
|
|
|
| namespace chromeos {
|
|
|
| -class ExistingUserController;
|
| -class WizardController;
|
| +class OobeUI;
|
| +class WebUILoginDisplay;
|
| +class WebUILoginView;
|
|
|
| -// An implementation class for OOBE/login screen host.
|
| +// An implementation class for OOBE/login WebUI screen host.
|
| // It encapsulates controllers, background integration and flow.
|
| class LoginDisplayHostImpl : public LoginDisplayHost,
|
| - public content::NotificationObserver {
|
| + public content::NotificationObserver,
|
| + public content::WebContentsObserver {
|
| public:
|
| explicit LoginDisplayHostImpl(const gfx::Rect& background_bounds);
|
| virtual ~LoginDisplayHostImpl();
|
| @@ -42,23 +47,35 @@ class LoginDisplayHostImpl : public LoginDisplayHost,
|
| }
|
|
|
| // LoginDisplayHost implementation:
|
| + virtual LoginDisplay* CreateLoginDisplay(
|
| + LoginDisplay::Delegate* delegate) OVERRIDE;
|
| + virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE;
|
| + virtual WebUILoginView* GetWebUILoginView() const OVERRIDE;
|
| + virtual views::Widget* GetWidget() const OVERRIDE;
|
| virtual void BeforeSessionStart() OVERRIDE;
|
| virtual void OnSessionStart() OVERRIDE;
|
| virtual void OnCompleteLogin() OVERRIDE;
|
| + virtual void OpenProxySettings() OVERRIDE;
|
| + virtual void SetOobeProgressBarVisible(bool visible) OVERRIDE;
|
| + virtual void SetShutdownButtonEnabled(bool enable) OVERRIDE;
|
| + virtual void SetStatusAreaVisible(bool visible) OVERRIDE;
|
| + virtual void CheckForAutoEnrollment() OVERRIDE;
|
| virtual void StartWizard(
|
| const std::string& first_screen_name,
|
| - DictionaryValue* screen_parameters) OVERRIDE;
|
| + scoped_ptr<DictionaryValue> screen_parameters) OVERRIDE;
|
| + virtual WizardController* GetWizardController() OVERRIDE;
|
| virtual void StartSignInScreen() OVERRIDE;
|
| virtual void ResumeSignInScreen() OVERRIDE;
|
| - virtual void CheckForAutoEnrollment() OVERRIDE;
|
| - virtual WizardController* GetWizardController() OVERRIDE;
|
| + virtual void OnPreferencesChanged() OVERRIDE;
|
|
|
| - // Creates specific WizardController.
|
| - virtual WizardController* CreateWizardController() = 0;
|
| + // Creates WizardController instance.
|
| + WizardController* CreateWizardController();
|
|
|
| - // Called when the first browser window is created, but before it's
|
| - // ready (shown).
|
| - virtual void OnBrowserCreated() = 0;
|
| + // Called when the first browser window is created, but before it's shown.
|
| + void OnBrowserCreated();
|
| +
|
| + // Returns instance of the OOBE WebUI.
|
| + OobeUI* GetOobeUI() const;
|
|
|
| const gfx::Rect& background_bounds() const { return background_bounds_; }
|
|
|
| @@ -68,6 +85,9 @@ class LoginDisplayHostImpl : public LoginDisplayHost,
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) OVERRIDE;
|
|
|
| + // Overridden from content::WebContentsObserver:
|
| + virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE;
|
| +
|
| private:
|
| // Marks display host for deletion.
|
| // If |post_quit_task| is true also posts Quit task to the MessageLoop.
|
| @@ -86,6 +106,22 @@ class LoginDisplayHostImpl : public LoginDisplayHost,
|
| // Forces auto-enrollment on the appropriate controller.
|
| void ForceAutoEnrollment();
|
|
|
| + // Loads given URL. Creates WebUILoginView if needed.
|
| + void LoadURL(const GURL& url);
|
| +
|
| + // Shows OOBE/sign in WebUI that was previously initialized in hidden state.
|
| + void ShowWebUI();
|
| +
|
| + // Starts postponed WebUI (OOBE/sign in) if it was waiting for
|
| + // wallpaper animation end.
|
| + void StartPostponedWebUI();
|
| +
|
| + // Initializes |login_window_| and |login_view_| fields if needed.
|
| + void InitLoginWindowAndView();
|
| +
|
| + // Closes |login_window_| and resets |login_window_| and |login_view_| fields.
|
| + void ResetLoginWindowAndView();
|
| +
|
| // Used to calculate position of the screens and background.
|
| gfx::Rect background_bounds_;
|
|
|
| @@ -116,6 +152,61 @@ class LoginDisplayHostImpl : public LoginDisplayHost,
|
| // True if session start is in progress.
|
| bool session_starting_;
|
|
|
| + // Container of the screen we are displaying.
|
| + views::Widget* login_window_;
|
| +
|
| + // Container of the view we are displaying.
|
| + WebUILoginView* login_view_;
|
| +
|
| + // Login display we are using.
|
| + WebUILoginDisplay* webui_login_display_;
|
| +
|
| + // True if alternate boot animation is enabled.
|
| + bool is_boot_animation2_enabled_;
|
| +
|
| + // True if the login display is the current screen.
|
| + bool is_showing_login_;
|
| +
|
| + // True if NOTIFICATION_WALLPAPER_ANIMATION_FINISHED notification has been
|
| + // received.
|
| + bool is_wallpaper_loaded_;
|
| +
|
| + // Stores status area current visibility to be applied once login WebUI
|
| + // is shown.
|
| + bool status_area_saved_visibility_;
|
| +
|
| + // If true, WebUI is initialized in a hidden state and shown after the
|
| + // wallpaper animation is finished (when it is enabled) or the user pods have
|
| + // been loaded (otherwise).
|
| + // By default is true. Could be used to tune performance if needed.
|
| + bool initialize_webui_hidden_;
|
| +
|
| + // True if WebUI is initialized in hidden state and we're waiting for
|
| + // wallpaper load animation to finish.
|
| + bool waiting_for_wallpaper_load_;
|
| +
|
| + // True if WebUI is initialized in hidden state and we're waiting for user
|
| + // pods to load.
|
| + bool waiting_for_user_pods_;
|
| +
|
| + // How many times renderer has crashed.
|
| + int crash_count_;
|
| +
|
| + // Way to restore if renderer have crashed.
|
| + enum {
|
| + RESTORE_UNKNOWN,
|
| + RESTORE_WIZARD,
|
| + RESTORE_SIGN_IN
|
| + } restore_path_;
|
| +
|
| + // Stored parameters for StartWizard, required to restore in case of crash.
|
| + std::string wizard_first_screen_name_;
|
| + scoped_ptr<DictionaryValue> wizard_screen_parameters_;
|
| +
|
| + // Old value of the ash::internal::kIgnoreSoloWindowFramePainterPolicy
|
| + // property of the root window for |login_window_|.
|
| + bool old_ignore_solo_window_frame_painter_policy_value_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostImpl);
|
| };
|
|
|
|
|