OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BASE_LOGIN_DISPLAY_HOST_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_BASE_LOGIN_DISPLAY_HOST_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_BASE_LOGIN_DISPLAY_HOST_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_BASE_LOGIN_DISPLAY_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "chrome/browser/chromeos/login/login_display.h" | 12 #include "chrome/browser/chromeos/login/login_display.h" |
13 #include "chrome/browser/chromeos/login/login_display_host.h" | 13 #include "chrome/browser/chromeos/login/login_display_host.h" |
14 #include "content/common/notification_observer.h" | 14 #include "content/common/notification_observer.h" |
15 #include "content/common/notification_registrar.h" | 15 #include "content/common/notification_registrar.h" |
16 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
17 | 17 |
18 namespace views { | 18 namespace views { |
19 class Widget; | 19 class Widget; |
20 } | 20 } |
21 | 21 |
22 namespace chromeos { | 22 namespace chromeos { |
23 | 23 |
24 class ExistingUserController; | 24 class ExistingUserController; |
| 25 class ViewsOobeDisplay; |
25 class WizardController; | 26 class WizardController; |
26 | 27 |
27 // An abstract base class that defines OOBE/login screen host. | 28 // An abstract base class that defines OOBE/login screen host. |
28 // It encapsulates controllers, background integration and flow. | 29 // It encapsulates controllers, background integration and flow. |
29 class BaseLoginDisplayHost : public LoginDisplayHost, | 30 class BaseLoginDisplayHost : public LoginDisplayHost, |
30 public NotificationObserver { | 31 public NotificationObserver { |
31 public: | 32 public: |
32 explicit BaseLoginDisplayHost(const gfx::Rect& background_bounds); | 33 explicit BaseLoginDisplayHost(const gfx::Rect& background_bounds); |
33 virtual ~BaseLoginDisplayHost(); | 34 virtual ~BaseLoginDisplayHost(); |
34 | 35 |
35 // Returns the default LoginDispalyHost instance if it has been created. | 36 // Returns the default LoginDispalyHost instance if it has been created. |
36 static LoginDisplayHost* default_host() { | 37 static LoginDisplayHost* default_host() { |
37 return default_host_; | 38 return default_host_; |
38 } | 39 } |
39 | 40 |
40 // LoginDisplayHost implementation: | 41 // LoginDisplayHost implementation: |
41 virtual void OnSessionStart(); | 42 virtual void OnSessionStart(); |
42 virtual void StartWizard( | 43 virtual void StartWizard( |
43 const std::string& first_screen_name, | 44 const std::string& first_screen_name, |
44 const GURL& start_url); | 45 const GURL& start_url); |
45 virtual void StartSignInScreen(); | 46 virtual void StartSignInScreen(); |
46 | 47 |
| 48 // Implementation specific WizardController creation method. |
| 49 virtual WizardController* CreateWizardController(); |
| 50 |
47 const gfx::Rect& background_bounds() const { return background_bounds_; } | 51 const gfx::Rect& background_bounds() const { return background_bounds_; } |
48 | 52 |
49 private: | 53 private: |
50 // NotificationObserver implementation: | 54 // NotificationObserver implementation: |
51 virtual void Observe(NotificationType type, | 55 virtual void Observe(NotificationType type, |
52 const NotificationSource& source, | 56 const NotificationSource& source, |
53 const NotificationDetails& details); | 57 const NotificationDetails& details); |
54 | 58 |
55 // Used to calculate position of the screens and background. | 59 // Used to calculate position of the screens and background. |
56 gfx::Rect background_bounds_; | 60 gfx::Rect background_bounds_; |
57 | 61 |
58 NotificationRegistrar registrar_; | 62 NotificationRegistrar registrar_; |
59 | 63 |
60 // Default LoginDisplayHost. | 64 // Default LoginDisplayHost. |
61 static LoginDisplayHost* default_host_; | 65 static LoginDisplayHost* default_host_; |
62 | 66 |
63 // Sign in screen controller. | 67 // Sign in screen controller. |
64 scoped_ptr<ExistingUserController> sign_in_controller_; | 68 scoped_ptr<ExistingUserController> sign_in_controller_; |
65 | 69 |
66 // OOBE and some screens (camera, recovery) controller. | 70 // OOBE and some screens (camera, recovery) controller. |
67 scoped_ptr<WizardController> wizard_controller_; | 71 scoped_ptr<WizardController> wizard_controller_; |
68 | 72 |
| 73 // Keeps views based OobeDisplay implementation if any. |
| 74 // TODO(altimofeev): move it to ViewsLoginDisplayHost. Also see comment in |
| 75 // the CreateWizardController(). |
| 76 scoped_ptr<ViewsOobeDisplay> oobe_display_; |
| 77 |
69 DISALLOW_COPY_AND_ASSIGN(BaseLoginDisplayHost); | 78 DISALLOW_COPY_AND_ASSIGN(BaseLoginDisplayHost); |
70 }; | 79 }; |
71 | 80 |
72 } // namespace chromeos | 81 } // namespace chromeos |
73 | 82 |
74 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_BASE_LOGIN_DISPLAY_HOST_H_ | 83 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_BASE_LOGIN_DISPLAY_HOST_H_ |
OLD | NEW |