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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // Returns value of LoginPerformer::password_changed() (cached if performer is | 136 // Returns value of LoginPerformer::password_changed() (cached if performer is |
137 // destroyed). | 137 // destroyed). |
138 bool password_changed() const; | 138 bool password_changed() const; |
139 | 139 |
140 private: | 140 private: |
141 friend class ExistingUserControllerTest; | 141 friend class ExistingUserControllerTest; |
142 friend class ExistingUserControllerAutoLoginTest; | 142 friend class ExistingUserControllerAutoLoginTest; |
143 friend class ExistingUserControllerPublicSessionTest; | 143 friend class ExistingUserControllerPublicSessionTest; |
144 friend class MockLoginPerformerDelegate; | 144 friend class MockLoginPerformerDelegate; |
145 | 145 |
| 146 FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerTest, ExistingUserLogin); |
| 147 |
146 void LoginAsGuest(); | 148 void LoginAsGuest(); |
147 void LoginAsPublicSession(const UserContext& user_context); | 149 void LoginAsPublicSession(const UserContext& user_context); |
148 void LoginAsKioskApp(const std::string& app_id, bool diagnostic_mode); | 150 void LoginAsKioskApp(const std::string& app_id, bool diagnostic_mode); |
149 void LoginAsArcKioskApp(const AccountId& account_id); | 151 void LoginAsArcKioskApp(const AccountId& account_id); |
150 // Retrieve public session and ARC kiosk auto-login policy and update the | 152 // Retrieve public session and ARC kiosk auto-login policy and update the |
151 // timer. | 153 // timer. |
152 void ConfigureAutoLogin(); | 154 void ConfigureAutoLogin(); |
153 | 155 |
154 // Trigger public session auto-login. | 156 // Trigger public session auto-login. |
155 void OnPublicSessionAutoLoginTimerFire(); | 157 void OnPublicSessionAutoLoginTimerFire(); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 // Used to execute login operations. | 284 // Used to execute login operations. |
283 std::unique_ptr<LoginPerformer> login_performer_; | 285 std::unique_ptr<LoginPerformer> login_performer_; |
284 | 286 |
285 // Delegate to forward all authentication status events to. | 287 // Delegate to forward all authentication status events to. |
286 // Tests can use this to receive authentication status events. | 288 // Tests can use this to receive authentication status events. |
287 AuthStatusConsumer* auth_status_consumer_ = nullptr; | 289 AuthStatusConsumer* auth_status_consumer_ = nullptr; |
288 | 290 |
289 // AccountId of the last login attempt. | 291 // AccountId of the last login attempt. |
290 AccountId last_login_attempt_account_id_ = EmptyAccountId(); | 292 AccountId last_login_attempt_account_id_ = EmptyAccountId(); |
291 | 293 |
| 294 // Whether the last login attempt was an auto login. |
| 295 bool last_login_attempt_was_auto_login_ = false; |
| 296 |
292 // OOBE/login display host. | 297 // OOBE/login display host. |
293 LoginDisplayHost* host_; | 298 LoginDisplayHost* host_; |
294 | 299 |
295 // Login UI implementation instance. | 300 // Login UI implementation instance. |
296 std::unique_ptr<LoginDisplay> login_display_; | 301 std::unique_ptr<LoginDisplay> login_display_; |
297 | 302 |
298 // Number of login attempts. Used to show help link when > 1 unsuccessful | 303 // Number of login attempts. Used to show help link when > 1 unsuccessful |
299 // logins for the same user. | 304 // logins for the same user. |
300 size_t num_login_attempts_ = 0; | 305 size_t num_login_attempts_ = 0; |
301 | 306 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 std::unique_ptr<CrosSettings::ObserverSubscription> | 368 std::unique_ptr<CrosSettings::ObserverSubscription> |
364 local_account_auto_login_delay_subscription_; | 369 local_account_auto_login_delay_subscription_; |
365 | 370 |
366 std::unique_ptr<BootstrapUserContextInitializer> | 371 std::unique_ptr<BootstrapUserContextInitializer> |
367 bootstrap_user_context_initializer_; | 372 bootstrap_user_context_initializer_; |
368 | 373 |
369 std::unique_ptr<OAuth2TokenInitializer> oauth2_token_initializer_; | 374 std::unique_ptr<OAuth2TokenInitializer> oauth2_token_initializer_; |
370 | 375 |
371 std::unique_ptr<TokenHandleUtil> token_handle_util_; | 376 std::unique_ptr<TokenHandleUtil> token_handle_util_; |
372 | 377 |
373 FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerTest, ExistingUserLogin); | |
374 | |
375 // Factory of callbacks. | 378 // Factory of callbacks. |
376 base::WeakPtrFactory<ExistingUserController> weak_factory_; | 379 base::WeakPtrFactory<ExistingUserController> weak_factory_; |
377 | 380 |
378 DISALLOW_COPY_AND_ASSIGN(ExistingUserController); | 381 DISALLOW_COPY_AND_ASSIGN(ExistingUserController); |
379 }; | 382 }; |
380 | 383 |
381 } // namespace chromeos | 384 } // namespace chromeos |
382 | 385 |
383 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ | 386 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ |
OLD | NEW |