| 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/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 12 #include "chrome/browser/chromeos/login/login_display.h" | 13 #include "chrome/browser/chromeos/login/login_display.h" |
| 13 #include "chrome/browser/chromeos/login/login_display_host.h" | 14 #include "chrome/browser/chromeos/login/login_display_host.h" |
| 14 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
| 15 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
| 16 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
| 17 | 18 |
| 18 namespace chromeos { | 19 namespace chromeos { |
| 19 | 20 |
| 20 class ExistingUserController; | 21 class ExistingUserController; |
| 21 class WizardController; | 22 class WizardController; |
| 22 | 23 |
| 23 // An abstract base class that defines OOBE/login screen host. | 24 // An abstract base class that defines OOBE/login screen host. |
| 24 // It encapsulates controllers, background integration and flow. | 25 // It encapsulates controllers, background integration and flow. |
| 25 class BaseLoginDisplayHost : public LoginDisplayHost, | 26 class BaseLoginDisplayHost : public LoginDisplayHost, |
| 26 public content::NotificationObserver { | 27 public content::NotificationObserver { |
| 27 public: | 28 public: |
| 28 explicit BaseLoginDisplayHost(const gfx::Rect& background_bounds); | 29 explicit BaseLoginDisplayHost(const gfx::Rect& background_bounds); |
| 29 virtual ~BaseLoginDisplayHost(); | 30 virtual ~BaseLoginDisplayHost(); |
| 30 | 31 |
| 31 // Returns the default LoginDispalyHost instance if it has been created. | 32 // Returns the default LoginDispalyHost instance if it has been created. |
| 32 static LoginDisplayHost* default_host() { | 33 static LoginDisplayHost* default_host() { |
| 33 return default_host_; | 34 return default_host_; |
| 34 } | 35 } |
| 35 | 36 |
| 36 // LoginDisplayHost implementation: | 37 // LoginDisplayHost implementation: |
| 37 virtual void OnSessionStart(); | 38 virtual void OnSessionStart() OVERRIDE; |
| 38 virtual void StartWizard( | 39 virtual void StartWizard( |
| 39 const std::string& first_screen_name, | 40 const std::string& first_screen_name, |
| 40 const GURL& start_url); | 41 const GURL& start_url) OVERRIDE; |
| 41 virtual void StartSignInScreen(); | 42 virtual void StartSignInScreen() OVERRIDE; |
| 42 | 43 |
| 43 // Creates specific WizardController. | 44 // Creates specific WizardController. |
| 44 virtual WizardController* CreateWizardController() = 0; | 45 virtual WizardController* CreateWizardController() = 0; |
| 45 | 46 |
| 46 const gfx::Rect& background_bounds() const { return background_bounds_; } | 47 const gfx::Rect& background_bounds() const { return background_bounds_; } |
| 47 | 48 |
| 48 private: | 49 private: |
| 49 // content::NotificationObserver implementation: | 50 // content::NotificationObserver implementation: |
| 50 virtual void Observe(int type, | 51 virtual void Observe(int type, |
| 51 const content::NotificationSource& source, | 52 const content::NotificationSource& source, |
| 52 const content::NotificationDetails& details); | 53 const content::NotificationDetails& details) OVERRIDE; |
| 53 | 54 |
| 54 // Used to calculate position of the screens and background. | 55 // Used to calculate position of the screens and background. |
| 55 gfx::Rect background_bounds_; | 56 gfx::Rect background_bounds_; |
| 56 | 57 |
| 57 content::NotificationRegistrar registrar_; | 58 content::NotificationRegistrar registrar_; |
| 58 | 59 |
| 59 // Default LoginDisplayHost. | 60 // Default LoginDisplayHost. |
| 60 static LoginDisplayHost* default_host_; | 61 static LoginDisplayHost* default_host_; |
| 61 | 62 |
| 62 // Sign in screen controller. | 63 // Sign in screen controller. |
| 63 scoped_ptr<ExistingUserController> sign_in_controller_; | 64 scoped_ptr<ExistingUserController> sign_in_controller_; |
| 64 | 65 |
| 65 // OOBE and some screens (camera, recovery) controller. | 66 // OOBE and some screens (camera, recovery) controller. |
| 66 scoped_ptr<WizardController> wizard_controller_; | 67 scoped_ptr<WizardController> wizard_controller_; |
| 67 | 68 |
| 68 DISALLOW_COPY_AND_ASSIGN(BaseLoginDisplayHost); | 69 DISALLOW_COPY_AND_ASSIGN(BaseLoginDisplayHost); |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 } // namespace chromeos | 72 } // namespace chromeos |
| 72 | 73 |
| 73 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_BASE_LOGIN_DISPLAY_HOST_H_ | 74 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_BASE_LOGIN_DISPLAY_HOST_H_ |
| OLD | NEW |