| 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_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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 virtual void Observe(int type, | 78 virtual void Observe(int type, |
| 79 const content::NotificationSource& source, | 79 const content::NotificationSource& source, |
| 80 const content::NotificationDetails& details); | 80 const content::NotificationDetails& details); |
| 81 | 81 |
| 82 // Set a delegate that we will pass LoginStatusConsumer events to. | 82 // Set a delegate that we will pass LoginStatusConsumer events to. |
| 83 // Used for testing. | 83 // Used for testing. |
| 84 void set_login_status_consumer(LoginStatusConsumer* consumer) { | 84 void set_login_status_consumer(LoginStatusConsumer* consumer) { |
| 85 login_status_consumer_ = consumer; | 85 login_status_consumer_ = consumer; |
| 86 } | 86 } |
| 87 | 87 |
| 88 // Returns the LoginDisplay instance created and owned by this controller. | 88 // Returns the LoginDisplay created and owned by this controller. |
| 89 // Used for testing. | 89 // Used for testing. |
| 90 LoginDisplay* login_display() { | 90 LoginDisplay* login_display() { |
| 91 return login_display_; | 91 return login_display_.get(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 // Returns the LoginDisplayHost for this controller. | 94 // Returns the LoginDisplayHost for this controller. |
| 95 // Used for testing. | |
| 96 LoginDisplayHost* login_display_host() { | 95 LoginDisplayHost* login_display_host() { |
| 97 return host_; | 96 return host_; |
| 98 } | 97 } |
| 99 | 98 |
| 100 private: | 99 private: |
| 101 friend class ExistingUserControllerTest; | 100 friend class ExistingUserControllerTest; |
| 102 friend class MockLoginPerformerDelegate; | 101 friend class MockLoginPerformerDelegate; |
| 103 | 102 |
| 104 // LoginPerformer::Delegate implementation: | 103 // LoginPerformer::Delegate implementation: |
| 105 virtual void OnLoginFailure(const LoginFailure& error); | 104 virtual void OnLoginFailure(const LoginFailure& error); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 login_performer_delegate_.reset(d); | 146 login_performer_delegate_.reset(d); |
| 148 } | 147 } |
| 149 | 148 |
| 150 // Passes owner user to cryptohomed. Called right before mounting a user. | 149 // Passes owner user to cryptohomed. Called right before mounting a user. |
| 151 // Subsequent disk space control checks are invoked by cryptohomed timer. | 150 // Subsequent disk space control checks are invoked by cryptohomed timer. |
| 152 void SetOwnerUserInCryptohome(); | 151 void SetOwnerUserInCryptohome(); |
| 153 | 152 |
| 154 // Used to execute login operations. | 153 // Used to execute login operations. |
| 155 scoped_ptr<LoginPerformer> login_performer_; | 154 scoped_ptr<LoginPerformer> login_performer_; |
| 156 | 155 |
| 157 // Login UI implementation instance. | |
| 158 LoginDisplay* login_display_; | |
| 159 | |
| 160 // Delegate for login performer to be overridden by tests. | 156 // Delegate for login performer to be overridden by tests. |
| 161 // |this| is used if |login_performer_delegate_| is NULL. | 157 // |this| is used if |login_performer_delegate_| is NULL. |
| 162 scoped_ptr<LoginPerformer::Delegate> login_performer_delegate_; | 158 scoped_ptr<LoginPerformer::Delegate> login_performer_delegate_; |
| 163 | 159 |
| 164 // Delegate to forward all login status events to. | 160 // Delegate to forward all login status events to. |
| 165 // Tests can use this to receive login status events. | 161 // Tests can use this to receive login status events. |
| 166 LoginStatusConsumer* login_status_consumer_; | 162 LoginStatusConsumer* login_status_consumer_; |
| 167 | 163 |
| 168 // Username of the last login attempt. | 164 // Username of the last login attempt. |
| 169 std::string last_login_attempt_username_; | 165 std::string last_login_attempt_username_; |
| 170 | 166 |
| 171 // OOBE/login display host. | 167 // OOBE/login display host. |
| 172 LoginDisplayHost* host_; | 168 LoginDisplayHost* host_; |
| 173 | 169 |
| 170 // Login UI implementation instance. |
| 171 scoped_ptr<LoginDisplay> login_display_; |
| 172 |
| 174 // Number of login attempts. Used to show help link when > 1 unsuccessful | 173 // Number of login attempts. Used to show help link when > 1 unsuccessful |
| 175 // logins for the same user. | 174 // logins for the same user. |
| 176 size_t num_login_attempts_; | 175 size_t num_login_attempts_; |
| 177 | 176 |
| 178 // Pointer to the current instance of the controller to be used by | 177 // Pointer to the current instance of the controller to be used by |
| 179 // automation tests. | 178 // automation tests. |
| 180 static ExistingUserController* current_controller_; | 179 static ExistingUserController* current_controller_; |
| 181 | 180 |
| 182 // Triggers prefetching of user settings. | 181 // Triggers prefetching of user settings. |
| 183 scoped_ptr<UserCrosSettingsProvider> user_settings_; | 182 scoped_ptr<UserCrosSettingsProvider> user_settings_; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 204 bool is_owner_login_; | 203 bool is_owner_login_; |
| 205 | 204 |
| 206 FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerTest, NewUserLogin); | 205 FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerTest, NewUserLogin); |
| 207 | 206 |
| 208 DISALLOW_COPY_AND_ASSIGN(ExistingUserController); | 207 DISALLOW_COPY_AND_ASSIGN(ExistingUserController); |
| 209 }; | 208 }; |
| 210 | 209 |
| 211 } // namespace chromeos | 210 } // namespace chromeos |
| 212 | 211 |
| 213 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ | 212 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ |
| OLD | NEW |