- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / login / login_display_host.h
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.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_HOST_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_HOST_H_
7
8 #include <string>
9
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"
16
17 namespace views {
18 class Widget;
19 }  // namespace views
20
21 namespace chromeos {
22
23 class AppLaunchController;
24 class WebUILoginView;
25 class WizardController;
26
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 {
31  public:
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;
37
38   virtual ~LoginDisplayHost() {}
39
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;
44
45   // Returns corresponding native window.
46   virtual gfx::NativeWindow GetNativeWindow() const = 0;
47
48   // Returns the current login view.
49   virtual WebUILoginView* GetWebUILoginView() const = 0;
50
51   // Called when browsing session starts before creating initial browser.
52   virtual void BeforeSessionStart() = 0;
53
54   // Called when user enters or returns to browsing session so
55   // LoginDisplayHost instance may delete itself.
56   virtual void Finalize() = 0;
57
58   // Called when a login has completed successfully.
59   virtual void OnCompleteLogin() = 0;
60
61   // Open proxy settings dialog.
62   virtual void OpenProxySettings() = 0;
63
64   // Toggles status area visibility.
65   virtual void SetStatusAreaVisible(bool visible) = 0;
66
67   // Signals the LoginDisplayHost that it can proceed with the Enterprise
68   // Auto-Enrollment checks now.
69   virtual void CheckForAutoEnrollment() = 0;
70
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;
76
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;
84
85   // Returns current WizardController, if it exists.
86   // Result should not be stored.
87   virtual WizardController* GetWizardController() = 0;
88
89   // Returns current AppLaunchController, if it exists.
90   // Result should not be stored.
91   virtual AppLaunchController* GetAppLaunchController() = 0;
92
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;
97
98   // Starts sign in screen.
99   virtual void StartSignInScreen() = 0;
100
101   // Resumes a previously started sign in screen.
102   virtual void ResumeSignInScreen() = 0;
103
104   // Invoked when system preferences that affect the signin screen have changed.
105   virtual void OnPreferencesChanged() = 0;
106
107   // Initiates authentication network prewarming.
108   virtual void PrewarmAuthentication() = 0;
109
110   // Starts app launch splash screen.
111   virtual void StartAppLaunch(const std::string& app_id) = 0;
112 };
113
114 }  // namespace chromeos
115
116 #endif  // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_HOST_H_