| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_LOGIN_DISPLAY_HOST_IMPL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_BASE_LOGIN_DISPLAY_HOST_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "chrome/browser/chromeos/login/login_display.h" | 13 #include "chrome/browser/chromeos/login/login_display.h" |
| 14 #include "chrome/browser/chromeos/login/login_display_host.h" | 14 #include "chrome/browser/chromeos/login/login_display_host.h" |
| 15 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 15 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 16 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
| 17 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 18 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
| 19 | 19 |
| 20 class PrefService; | 20 class PrefService; |
| 21 | 21 |
| 22 namespace policy { | 22 namespace policy { |
| 23 class AutoEnrollmentClient; | 23 class AutoEnrollmentClient; |
| 24 } // namespace policy | 24 } // namespace policy |
| 25 | 25 |
| 26 namespace chromeos { | 26 namespace chromeos { |
| 27 | 27 |
| 28 class ExistingUserController; | 28 class ExistingUserController; |
| 29 class WizardController; | 29 class WizardController; |
| 30 | 30 |
| 31 // An abstract base class that defines OOBE/login screen host. | 31 // An implementation class for OOBE/login screen host. |
| 32 // It encapsulates controllers, background integration and flow. | 32 // It encapsulates controllers, background integration and flow. |
| 33 class BaseLoginDisplayHost : public LoginDisplayHost, | 33 class LoginDisplayHostImpl : public LoginDisplayHost, |
| 34 public content::NotificationObserver { | 34 public content::NotificationObserver { |
| 35 public: | 35 public: |
| 36 explicit BaseLoginDisplayHost(const gfx::Rect& background_bounds); | 36 explicit LoginDisplayHostImpl(const gfx::Rect& background_bounds); |
| 37 virtual ~BaseLoginDisplayHost(); | 37 virtual ~LoginDisplayHostImpl(); |
| 38 | 38 |
| 39 // Returns the default LoginDispalyHost instance if it has been created. | 39 // Returns the default LoginDispalyHost instance if it has been created. |
| 40 static LoginDisplayHost* default_host() { | 40 static LoginDisplayHost* default_host() { |
| 41 return default_host_; | 41 return default_host_; |
| 42 } | 42 } |
| 43 | 43 |
| 44 // LoginDisplayHost implementation: | 44 // LoginDisplayHost implementation: |
| 45 virtual void BeforeSessionStart() OVERRIDE; | 45 virtual void BeforeSessionStart() OVERRIDE; |
| 46 virtual void OnSessionStart() OVERRIDE; | 46 virtual void OnSessionStart() OVERRIDE; |
| 47 virtual void OnCompleteLogin() OVERRIDE; | 47 virtual void OnCompleteLogin() OVERRIDE; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 void OnAutoEnrollmentClientDone(); | 84 void OnAutoEnrollmentClientDone(); |
| 85 | 85 |
| 86 // Forces auto-enrollment on the appropriate controller. | 86 // Forces auto-enrollment on the appropriate controller. |
| 87 void ForceAutoEnrollment(); | 87 void ForceAutoEnrollment(); |
| 88 | 88 |
| 89 // Used to calculate position of the screens and background. | 89 // Used to calculate position of the screens and background. |
| 90 gfx::Rect background_bounds_; | 90 gfx::Rect background_bounds_; |
| 91 | 91 |
| 92 content::NotificationRegistrar registrar_; | 92 content::NotificationRegistrar registrar_; |
| 93 | 93 |
| 94 base::WeakPtrFactory<BaseLoginDisplayHost> pointer_factory_; | 94 base::WeakPtrFactory<LoginDisplayHostImpl> pointer_factory_; |
| 95 | 95 |
| 96 // Default LoginDisplayHost. | 96 // Default LoginDisplayHost. |
| 97 static LoginDisplayHost* default_host_; | 97 static LoginDisplayHost* default_host_; |
| 98 | 98 |
| 99 // Sign in screen controller. | 99 // Sign in screen controller. |
| 100 scoped_ptr<ExistingUserController> sign_in_controller_; | 100 scoped_ptr<ExistingUserController> sign_in_controller_; |
| 101 | 101 |
| 102 // OOBE and some screens (camera, recovery) controller. | 102 // OOBE and some screens (camera, recovery) controller. |
| 103 scoped_ptr<WizardController> wizard_controller_; | 103 scoped_ptr<WizardController> wizard_controller_; |
| 104 | 104 |
| 105 // Client for enterprise auto-enrollment check. | 105 // Client for enterprise auto-enrollment check. |
| 106 scoped_ptr<policy::AutoEnrollmentClient> auto_enrollment_client_; | 106 scoped_ptr<policy::AutoEnrollmentClient> auto_enrollment_client_; |
| 107 | 107 |
| 108 // Has ShutdownDisplayHost() already been called? Used to avoid posting our | 108 // Has ShutdownDisplayHost() already been called? Used to avoid posting our |
| 109 // own deletion to the message loop twice if the user logs out while we're | 109 // own deletion to the message loop twice if the user logs out while we're |
| 110 // still in the process of cleaning up after login (http://crbug.com/134463). | 110 // still in the process of cleaning up after login (http://crbug.com/134463). |
| 111 bool shutting_down_; | 111 bool shutting_down_; |
| 112 | 112 |
| 113 // Whether progress bar is shown on the OOBE page. | 113 // Whether progress bar is shown on the OOBE page. |
| 114 bool oobe_progress_bar_visible_; | 114 bool oobe_progress_bar_visible_; |
| 115 | 115 |
| 116 // True if session start is in progress. | 116 // True if session start is in progress. |
| 117 bool session_starting_; | 117 bool session_starting_; |
| 118 | 118 |
| 119 DISALLOW_COPY_AND_ASSIGN(BaseLoginDisplayHost); | 119 DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostImpl); |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 } // namespace chromeos | 122 } // namespace chromeos |
| 123 | 123 |
| 124 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_BASE_LOGIN_DISPLAY_HOST_H_ | 124 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_HOST_IMPL_H_ |
| OLD | NEW |