Home | History | Annotate | Download | only in ui
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_H_
      6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_H_
      7 
      8 #include <string>
      9 
     10 #include "base/callback.h"
     11 #include "base/callback_list.h"
     12 #include "base/memory/scoped_ptr.h"
     13 #include "base/values.h"
     14 #include "chrome/browser/chromeos/customization_document.h"
     15 #include "chrome/browser/chromeos/login/ui/login_display.h"
     16 #include "ui/gfx/native_widget_types.h"
     17 
     18 namespace views {
     19 class Widget;
     20 }  // namespace views
     21 
     22 namespace chromeos {
     23 
     24 class AppLaunchController;
     25 class AutoEnrollmentController;
     26 class LoginScreenContext;
     27 class WebUILoginView;
     28 class WizardController;
     29 
     30 // An interface that defines OOBE/login screen host.
     31 // Host encapsulates WebUI window OOBE/login controllers,
     32 // UI implementation (such as LoginDisplay).
     33 class LoginDisplayHost {
     34  public:
     35   virtual ~LoginDisplayHost() {}
     36 
     37   // Creates UI implementation specific login display instance (views/WebUI).
     38   // The caller takes ownership of the returned value.
     39   virtual LoginDisplay* CreateLoginDisplay(
     40       LoginDisplay::Delegate* delegate) = 0;
     41 
     42   // Returns corresponding native window.
     43   virtual gfx::NativeWindow GetNativeWindow() const = 0;
     44 
     45   // Returns the current login view.
     46   virtual WebUILoginView* GetWebUILoginView() const = 0;
     47 
     48   // Called when browsing session starts before creating initial browser.
     49   virtual void BeforeSessionStart() = 0;
     50 
     51   // Called when user enters or returns to browsing session so
     52   // LoginDisplayHost instance may delete itself.
     53   virtual void Finalize() = 0;
     54 
     55   // Called when a login has completed successfully.
     56   virtual void OnCompleteLogin() = 0;
     57 
     58   // Open proxy settings dialog.
     59   virtual void OpenProxySettings() = 0;
     60 
     61   // Toggles status area visibility.
     62   virtual void SetStatusAreaVisible(bool visible) = 0;
     63 
     64   // Gets the auto-enrollment client.
     65   virtual AutoEnrollmentController* GetAutoEnrollmentController() = 0;
     66 
     67   // Starts out-of-box-experience flow or shows other screen handled by
     68   // Wizard controller i.e. camera, recovery.
     69   // One could specify start screen with |first_screen_name|.
     70   // Takes ownership of |screen_parameters|, which can also be NULL.
     71   virtual void StartWizard(
     72       const std::string& first_screen_name,
     73       scoped_ptr<base::DictionaryValue> screen_parameters) = 0;
     74 
     75   // Returns current WizardController, if it exists.
     76   // Result should not be stored.
     77   virtual WizardController* GetWizardController() = 0;
     78 
     79   // Returns current AppLaunchController, if it exists.
     80   // Result should not be stored.
     81   virtual AppLaunchController* GetAppLaunchController() = 0;
     82 
     83   // Starts screen for adding user into session.
     84   // |completion_callback| called before display host shutdown.
     85   // |completion_callback| can be null.
     86   virtual void StartUserAdding(const base::Closure& completion_callback) = 0;
     87 
     88   // Starts sign in screen.
     89   virtual void StartSignInScreen(const LoginScreenContext& context) = 0;
     90 
     91   // Resumes a previously started sign in screen.
     92   virtual void ResumeSignInScreen() = 0;
     93 
     94   // Invoked when system preferences that affect the signin screen have changed.
     95   virtual void OnPreferencesChanged() = 0;
     96 
     97   // Initiates authentication network prewarming.
     98   virtual void PrewarmAuthentication() = 0;
     99 
    100   // Starts app launch splash screen.
    101   virtual void StartAppLaunch(const std::string& app_id,
    102                               bool diagnostic_mode) = 0;
    103 
    104   // Starts the demo app launch.
    105   virtual void StartDemoAppLaunch() = 0;
    106 };
    107 
    108 }  // namespace chromeos
    109 
    110 #endif  // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_H_
    111