1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_HOST_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_HOST_H_
10 #include "base/callback.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/values.h"
13 #include "chrome/browser/chromeos/customization_document.h"
14 #include "chrome/browser/chromeos/login/login_display.h"
15 #include "ui/gfx/native_widget_types.h"
23 class AppLaunchController;
25 class WizardController;
27 // An interface that defines OOBE/login screen host.
28 // Host encapsulates WebUI window OOBE/login controllers,
29 // UI implementation (such as LoginDisplay).
30 class LoginDisplayHost {
32 // Callback for GetAutoEnrollmentCheckResult. It is invoked with when
33 // a decision is made for auto enrollment. It is invoked with "true" when
34 // auto enrollment check is finished and auto enrollment should be enforced.
35 // Otherwise, it is invoked with "false".
36 typedef base::Callback<void(bool)> GetAutoEnrollmentCheckResultCallback;
38 virtual ~LoginDisplayHost() {}
40 // Creates UI implementation specific login display instance (views/WebUI).
41 // The caller takes ownership of the returned value.
42 virtual LoginDisplay* CreateLoginDisplay(
43 LoginDisplay::Delegate* delegate) = 0;
45 // Returns corresponding native window.
46 virtual gfx::NativeWindow GetNativeWindow() const = 0;
48 // Returns the current login view.
49 virtual WebUILoginView* GetWebUILoginView() const = 0;
51 // Called when browsing session starts before creating initial browser.
52 virtual void BeforeSessionStart() = 0;
54 // Called when user enters or returns to browsing session so
55 // LoginDisplayHost instance may delete itself.
56 virtual void Finalize() = 0;
58 // Called when a login has completed successfully.
59 virtual void OnCompleteLogin() = 0;
61 // Open proxy settings dialog.
62 virtual void OpenProxySettings() = 0;
64 // Toggles status area visibility.
65 virtual void SetStatusAreaVisible(bool visible) = 0;
67 // Signals the LoginDisplayHost that it can proceed with the Enterprise
68 // Auto-Enrollment checks now.
69 virtual void CheckForAutoEnrollment() = 0;
71 // Gets the auto enrollment check results. If the check is still pending,
72 // |callback| will be invoked asynchronously after it is finished. Otherwise,
73 // |callback| is invoked synchronously before this call returns.
74 virtual void GetAutoEnrollmentCheckResult(
75 const GetAutoEnrollmentCheckResultCallback& callback) = 0;
77 // Starts out-of-box-experience flow or shows other screen handled by
78 // Wizard controller i.e. camera, recovery.
79 // One could specify start screen with |first_screen_name|.
80 // Takes ownership of |screen_parameters|, which can also be NULL.
81 virtual void StartWizard(
82 const std::string& first_screen_name,
83 scoped_ptr<DictionaryValue> screen_parameters) = 0;
85 // Returns current WizardController, if it exists.
86 // Result should not be stored.
87 virtual WizardController* GetWizardController() = 0;
89 // Returns current AppLaunchController, if it exists.
90 // Result should not be stored.
91 virtual AppLaunchController* GetAppLaunchController() = 0;
93 // Starts screen for adding user into session.
94 // |completion_callback| called before display host shutdown.
95 // |completion_callback| can be null.
96 virtual void StartUserAdding(const base::Closure& completion_callback) = 0;
98 // Starts sign in screen.
99 virtual void StartSignInScreen() = 0;
101 // Resumes a previously started sign in screen.
102 virtual void ResumeSignInScreen() = 0;
104 // Invoked when system preferences that affect the signin screen have changed.
105 virtual void OnPreferencesChanged() = 0;
107 // Initiates authentication network prewarming.
108 virtual void PrewarmAuthentication() = 0;
110 // Starts app launch splash screen.
111 virtual void StartAppLaunch(const std::string& app_id) = 0;
114 } // namespace chromeos
116 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_HOST_H_