| 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_EXISTING_USER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // all login UI implementation. | 48 // all login UI implementation. |
| 49 // ExistingUserController maintains it's own life cycle and deletes itself when | 49 // ExistingUserController maintains it's own life cycle and deletes itself when |
| 50 // the user logs in (or chooses to see other settings). | 50 // the user logs in (or chooses to see other settings). |
| 51 class ExistingUserController : public LoginDisplay::Delegate, | 51 class ExistingUserController : public LoginDisplay::Delegate, |
| 52 public content::NotificationObserver, | 52 public content::NotificationObserver, |
| 53 public LoginPerformer::Delegate, | 53 public LoginPerformer::Delegate, |
| 54 public LoginUtils::Delegate { | 54 public LoginUtils::Delegate { |
| 55 public: | 55 public: |
| 56 // All UI initialization is deferred till Init() call. | 56 // All UI initialization is deferred till Init() call. |
| 57 explicit ExistingUserController(LoginDisplayHost* host); | 57 explicit ExistingUserController(LoginDisplayHost* host); |
| 58 virtual ~ExistingUserController(); | 58 ~ExistingUserController() override; |
| 59 | 59 |
| 60 // Returns the current existing user controller if it has been created. | 60 // Returns the current existing user controller if it has been created. |
| 61 static ExistingUserController* current_controller() { | 61 static ExistingUserController* current_controller() { |
| 62 return current_controller_; | 62 return current_controller_; |
| 63 } | 63 } |
| 64 | 64 |
| 65 // Creates and shows login UI for known users. | 65 // Creates and shows login UI for known users. |
| 66 void Init(const user_manager::UserList& users); | 66 void Init(const user_manager::UserList& users); |
| 67 | 67 |
| 68 // Start the public session auto-login timer. | 68 // Start the public session auto-login timer. |
| 69 void StartPublicSessionAutoLoginTimer(); | 69 void StartPublicSessionAutoLoginTimer(); |
| 70 | 70 |
| 71 // Stop the public session auto-login timer when a login attempt begins. | 71 // Stop the public session auto-login timer when a login attempt begins. |
| 72 void StopPublicSessionAutoLoginTimer(); | 72 void StopPublicSessionAutoLoginTimer(); |
| 73 | 73 |
| 74 // LoginDisplay::Delegate: implementation | 74 // LoginDisplay::Delegate: implementation |
| 75 virtual void CancelPasswordChangedFlow() override; | 75 void CancelPasswordChangedFlow() override; |
| 76 virtual void CreateAccount() override; | 76 void CreateAccount() override; |
| 77 virtual void CompleteLogin(const UserContext& user_context) override; | 77 void CompleteLogin(const UserContext& user_context) override; |
| 78 virtual base::string16 GetConnectedNetworkName() override; | 78 base::string16 GetConnectedNetworkName() override; |
| 79 virtual bool IsSigninInProgress() const override; | 79 bool IsSigninInProgress() const override; |
| 80 virtual void Login(const UserContext& user_context, | 80 void Login(const UserContext& user_context, |
| 81 const SigninSpecifics& specifics) override; | 81 const SigninSpecifics& specifics) override; |
| 82 virtual void MigrateUserData(const std::string& old_password) override; | 82 void MigrateUserData(const std::string& old_password) override; |
| 83 virtual void OnSigninScreenReady() override; | 83 void OnSigninScreenReady() override; |
| 84 virtual void OnStartEnterpriseEnrollment() override; | 84 void OnStartEnterpriseEnrollment() override; |
| 85 virtual void OnStartEnableDebuggingScreen() override; | 85 void OnStartEnableDebuggingScreen() override; |
| 86 virtual void OnStartKioskEnableScreen() override; | 86 void OnStartKioskEnableScreen() override; |
| 87 virtual void OnStartKioskAutolaunchScreen() override; | 87 void OnStartKioskAutolaunchScreen() override; |
| 88 virtual void ResetPublicSessionAutoLoginTimer() override; | 88 void ResetPublicSessionAutoLoginTimer() override; |
| 89 virtual void ResyncUserData() override; | 89 void ResyncUserData() override; |
| 90 virtual void SetDisplayEmail(const std::string& email) override; | 90 void SetDisplayEmail(const std::string& email) override; |
| 91 virtual void ShowWrongHWIDScreen() override; | 91 void ShowWrongHWIDScreen() override; |
| 92 virtual void Signout() override; | 92 void Signout() override; |
| 93 | 93 |
| 94 // content::NotificationObserver implementation. | 94 // content::NotificationObserver implementation. |
| 95 virtual void Observe(int type, | 95 void Observe(int type, |
| 96 const content::NotificationSource& source, | 96 const content::NotificationSource& source, |
| 97 const content::NotificationDetails& details) override; | 97 const content::NotificationDetails& details) override; |
| 98 | 98 |
| 99 // Set a delegate that we will pass AuthStatusConsumer events to. | 99 // Set a delegate that we will pass AuthStatusConsumer events to. |
| 100 // Used for testing. | 100 // Used for testing. |
| 101 void set_login_status_consumer(AuthStatusConsumer* consumer) { | 101 void set_login_status_consumer(AuthStatusConsumer* consumer) { |
| 102 auth_status_consumer_ = consumer; | 102 auth_status_consumer_ = consumer; |
| 103 } | 103 } |
| 104 | 104 |
| 105 // Returns the LoginDisplay created and owned by this controller. | 105 // Returns the LoginDisplay created and owned by this controller. |
| 106 // Used for testing. | 106 // Used for testing. |
| 107 LoginDisplay* login_display() { | 107 LoginDisplay* login_display() { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 131 void LoginAsPublicSession(const UserContext& user_context); | 131 void LoginAsPublicSession(const UserContext& user_context); |
| 132 void LoginAsKioskApp(const std::string& app_id, bool diagnostic_mode); | 132 void LoginAsKioskApp(const std::string& app_id, bool diagnostic_mode); |
| 133 | 133 |
| 134 // Retrieve public session auto-login policy and update the timer. | 134 // Retrieve public session auto-login policy and update the timer. |
| 135 void ConfigurePublicSessionAutoLogin(); | 135 void ConfigurePublicSessionAutoLogin(); |
| 136 | 136 |
| 137 // Trigger public session auto-login. | 137 // Trigger public session auto-login. |
| 138 void OnPublicSessionAutoLoginTimerFire(); | 138 void OnPublicSessionAutoLoginTimerFire(); |
| 139 | 139 |
| 140 // LoginPerformer::Delegate implementation: | 140 // LoginPerformer::Delegate implementation: |
| 141 virtual void OnAuthFailure(const AuthFailure& error) override; | 141 void OnAuthFailure(const AuthFailure& error) override; |
| 142 virtual void OnAuthSuccess(const UserContext& user_context) override; | 142 void OnAuthSuccess(const UserContext& user_context) override; |
| 143 virtual void OnOffTheRecordAuthSuccess() override; | 143 void OnOffTheRecordAuthSuccess() override; |
| 144 virtual void OnPasswordChangeDetected() override; | 144 void OnPasswordChangeDetected() override; |
| 145 virtual void WhiteListCheckFailed(const std::string& email) override; | 145 void WhiteListCheckFailed(const std::string& email) override; |
| 146 virtual void PolicyLoadFailed() override; | 146 void PolicyLoadFailed() override; |
| 147 virtual void OnOnlineChecked( | 147 void OnOnlineChecked(const std::string& username, bool success) override; |
| 148 const std::string& username, bool success) override; | |
| 149 | 148 |
| 150 // LoginUtils::Delegate implementation: | 149 // LoginUtils::Delegate implementation: |
| 151 virtual void OnProfilePrepared(Profile* profile, | 150 void OnProfilePrepared(Profile* profile, bool browser_launched) override; |
| 152 bool browser_launched) override; | |
| 153 | 151 |
| 154 // Called when device settings change. | 152 // Called when device settings change. |
| 155 void DeviceSettingsChanged(); | 153 void DeviceSettingsChanged(); |
| 156 | 154 |
| 157 // Returns corresponding native window. | 155 // Returns corresponding native window. |
| 158 gfx::NativeWindow GetNativeWindow() const; | 156 gfx::NativeWindow GetNativeWindow() const; |
| 159 | 157 |
| 160 // Show error message. |error_id| error message ID in resources. | 158 // Show error message. |error_id| error message ID in resources. |
| 161 // If |details| string is not empty, it specify additional error text | 159 // If |details| string is not empty, it specify additional error text |
| 162 // provided by authenticator, it is not localized. | 160 // provided by authenticator, it is not localized. |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 | 308 |
| 311 // Factory of callbacks. | 309 // Factory of callbacks. |
| 312 base::WeakPtrFactory<ExistingUserController> weak_factory_; | 310 base::WeakPtrFactory<ExistingUserController> weak_factory_; |
| 313 | 311 |
| 314 DISALLOW_COPY_AND_ASSIGN(ExistingUserController); | 312 DISALLOW_COPY_AND_ASSIGN(ExistingUserController); |
| 315 }; | 313 }; |
| 316 | 314 |
| 317 } // namespace chromeos | 315 } // namespace chromeos |
| 318 | 316 |
| 319 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ | 317 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ |
| OLD | NEW |