OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_IMPL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_IMPL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_IMPL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 28 matching lines...) Expand all Loading... |
39 namespace content { | 39 namespace content { |
40 class RenderFrameHost; | 40 class RenderFrameHost; |
41 class WebContents; | 41 class WebContents; |
42 } | 42 } |
43 | 43 |
44 namespace chromeos { | 44 namespace chromeos { |
45 | 45 |
46 class DemoAppLauncher; | 46 class DemoAppLauncher; |
47 class FocusRingController; | 47 class FocusRingController; |
48 class KeyboardDrivenOobeKeyHandler; | 48 class KeyboardDrivenOobeKeyHandler; |
49 class OobeUI; | |
50 class WebUILoginDisplay; | 49 class WebUILoginDisplay; |
51 class WebUILoginView; | 50 class WebUILoginView; |
52 | 51 |
53 // An implementation class for OOBE/login WebUI screen host. | 52 // An implementation class for OOBE/login WebUI screen host. |
54 // It encapsulates controllers, background integration and flow. | 53 // It encapsulates controllers, background integration and flow. |
55 class LoginDisplayHostImpl : public LoginDisplayHost, | 54 class LoginDisplayHostImpl : public LoginDisplayHost, |
56 public content::NotificationObserver, | 55 public content::NotificationObserver, |
57 public content::WebContentsObserver, | 56 public content::WebContentsObserver, |
58 public chromeos::SessionManagerClient::Observer, | 57 public chromeos::SessionManagerClient::Observer, |
59 public chromeos::CrasAudioHandler::AudioObserver, | 58 public chromeos::CrasAudioHandler::AudioObserver, |
60 public ash::VirtualKeyboardStateObserver, | 59 public ash::VirtualKeyboardStateObserver, |
61 public keyboard::KeyboardControllerObserver, | 60 public keyboard::KeyboardControllerObserver, |
62 public gfx::DisplayObserver, | 61 public gfx::DisplayObserver, |
63 public views::WidgetRemovalsObserver { | 62 public views::WidgetRemovalsObserver { |
64 public: | 63 public: |
65 explicit LoginDisplayHostImpl(const gfx::Rect& background_bounds); | 64 explicit LoginDisplayHostImpl(const gfx::Rect& background_bounds); |
66 ~LoginDisplayHostImpl() override; | 65 ~LoginDisplayHostImpl() override; |
67 | 66 |
68 // Returns the default LoginDisplayHost instance if it has been created. | |
69 static LoginDisplayHost* default_host() { | |
70 return default_host_; | |
71 } | |
72 | |
73 // LoginDisplayHost implementation: | 67 // LoginDisplayHost implementation: |
74 LoginDisplay* CreateLoginDisplay(LoginDisplay::Delegate* delegate) override; | 68 LoginDisplay* CreateLoginDisplay(LoginDisplay::Delegate* delegate) override; |
75 gfx::NativeWindow GetNativeWindow() const override; | 69 gfx::NativeWindow GetNativeWindow() const override; |
| 70 OobeUI* GetOobeUI() const override; |
76 WebUILoginView* GetWebUILoginView() const override; | 71 WebUILoginView* GetWebUILoginView() const override; |
77 void BeforeSessionStart() override; | 72 void BeforeSessionStart() override; |
78 void Finalize() override; | 73 void Finalize() override; |
79 void OnCompleteLogin() override; | 74 void OnCompleteLogin() override; |
80 void OpenProxySettings() override; | 75 void OpenProxySettings() override; |
81 void SetStatusAreaVisible(bool visible) override; | 76 void SetStatusAreaVisible(bool visible) override; |
82 AutoEnrollmentController* GetAutoEnrollmentController() override; | 77 AutoEnrollmentController* GetAutoEnrollmentController() override; |
83 void StartWizard(const std::string& first_screen_name) override; | 78 void StartWizard(const std::string& first_screen_name) override; |
84 WizardController* GetWizardController() override; | 79 WizardController* GetWizardController() override; |
85 AppLaunchController* GetAppLaunchController() override; | 80 AppLaunchController* GetAppLaunchController() override; |
86 void StartUserAdding(const base::Closure& completion_callback) override; | 81 void StartUserAdding(const base::Closure& completion_callback) override; |
87 void StartSignInScreen(const LoginScreenContext& context) override; | 82 void StartSignInScreen(const LoginScreenContext& context) override; |
88 void OnPreferencesChanged() override; | 83 void OnPreferencesChanged() override; |
89 void PrewarmAuthentication() override; | 84 void PrewarmAuthentication() override; |
90 void StartAppLaunch( | 85 void StartAppLaunch( |
91 const std::string& app_id, | 86 const std::string& app_id, |
92 bool diagnostic_mode, | 87 bool diagnostic_mode, |
93 bool auto_launch) override; | 88 bool auto_launch) override; |
94 void StartDemoAppLaunch() override; | 89 void StartDemoAppLaunch() override; |
95 | 90 |
96 // Creates WizardController instance. | 91 // Creates WizardController instance. |
97 WizardController* CreateWizardController(); | 92 WizardController* CreateWizardController(); |
98 | 93 |
99 // Called when the first browser window is created, but before it's shown. | 94 // Called when the first browser window is created, but before it's shown. |
100 void OnBrowserCreated(); | 95 void OnBrowserCreated(); |
101 | 96 |
102 // Returns instance of the OOBE WebUI. | |
103 OobeUI* GetOobeUI() const; | |
104 | |
105 const gfx::Rect& background_bounds() const { return background_bounds_; } | 97 const gfx::Rect& background_bounds() const { return background_bounds_; } |
106 | 98 |
107 // Trace id for ShowLoginWebUI event (since there exists at most one login | 99 // Trace id for ShowLoginWebUI event (since there exists at most one login |
108 // WebUI at a time). | 100 // WebUI at a time). |
109 static const int kShowLoginWebUIid; | 101 static const int kShowLoginWebUIid; |
110 | 102 |
111 views::Widget* login_window_for_test() { return login_window_; } | 103 views::Widget* login_window_for_test() { return login_window_; } |
112 | 104 |
113 void StartTimeZoneResolve(); | 105 void StartTimeZoneResolve(); |
114 | 106 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 void TryToPlayStartupSound(); | 192 void TryToPlayStartupSound(); |
201 | 193 |
202 // Called when login-prompt-visible signal is caught. | 194 // Called when login-prompt-visible signal is caught. |
203 void OnLoginPromptVisible(); | 195 void OnLoginPromptVisible(); |
204 | 196 |
205 // Used to calculate position of the screens and background. | 197 // Used to calculate position of the screens and background. |
206 gfx::Rect background_bounds_; | 198 gfx::Rect background_bounds_; |
207 | 199 |
208 content::NotificationRegistrar registrar_; | 200 content::NotificationRegistrar registrar_; |
209 | 201 |
210 // Default LoginDisplayHost. | |
211 static LoginDisplayHost* default_host_; | |
212 | |
213 // The controller driving the auto-enrollment check. | 202 // The controller driving the auto-enrollment check. |
214 scoped_ptr<AutoEnrollmentController> auto_enrollment_controller_; | 203 scoped_ptr<AutoEnrollmentController> auto_enrollment_controller_; |
215 | 204 |
216 // Sign in screen controller. | 205 // Sign in screen controller. |
217 scoped_ptr<ExistingUserController> existing_user_controller_; | 206 scoped_ptr<ExistingUserController> existing_user_controller_; |
218 | 207 |
219 // OOBE and some screens (camera, recovery) controller. | 208 // OOBE and some screens (camera, recovery) controller. |
220 scoped_ptr<WizardController> wizard_controller_; | 209 scoped_ptr<WizardController> wizard_controller_; |
221 | 210 |
222 scoped_ptr<SignInScreenController> signin_screen_controller_; | 211 scoped_ptr<SignInScreenController> signin_screen_controller_; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 307 |
319 base::WeakPtrFactory<LoginDisplayHostImpl> pointer_factory_; | 308 base::WeakPtrFactory<LoginDisplayHostImpl> pointer_factory_; |
320 base::WeakPtrFactory<LoginDisplayHostImpl> animation_weak_ptr_factory_; | 309 base::WeakPtrFactory<LoginDisplayHostImpl> animation_weak_ptr_factory_; |
321 | 310 |
322 DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostImpl); | 311 DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostImpl); |
323 }; | 312 }; |
324 | 313 |
325 } // namespace chromeos | 314 } // namespace chromeos |
326 | 315 |
327 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_IMPL_H_ | 316 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_IMPL_H_ |
OLD | NEW |