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 20 matching lines...) Expand all Loading... |
31 | 31 |
32 namespace base { | 32 namespace base { |
33 class ListValue; | 33 class ListValue; |
34 } | 34 } |
35 | 35 |
36 namespace chromeos { | 36 namespace chromeos { |
37 | 37 |
38 class BootstrapUserContextInitializer; | 38 class BootstrapUserContextInitializer; |
39 class CrosSettings; | 39 class CrosSettings; |
40 class LoginDisplayHost; | 40 class LoginDisplayHost; |
| 41 class OAuth2TokenInitializer; |
41 | 42 |
42 namespace login { | 43 namespace login { |
43 class NetworkStateHelper; | 44 class NetworkStateHelper; |
44 } | 45 } |
45 | 46 |
46 // ExistingUserController is used to handle login when someone has | 47 // ExistingUserController is used to handle login when someone has |
47 // already logged into the machine. | 48 // already logged into the machine. |
48 // To use ExistingUserController create an instance of it and invoke Init. | 49 // To use ExistingUserController create an instance of it and invoke Init. |
49 // When Init is called it creates LoginDisplay instance which encapsulates | 50 // When Init is called it creates LoginDisplay instance which encapsulates |
50 // all login UI implementation. | 51 // all login UI implementation. |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 232 |
232 // Signs in as a known user. This is a continuation of Login() that gets | 233 // Signs in as a known user. This is a continuation of Login() that gets |
233 // invoked after it has been verified that the device is not disabled. | 234 // invoked after it has been verified that the device is not disabled. |
234 void DoLogin(const UserContext& user_context, | 235 void DoLogin(const UserContext& user_context, |
235 const SigninSpecifics& specifics); | 236 const SigninSpecifics& specifics); |
236 | 237 |
237 // Callback invoked when |bootstrap_user_context_initializer_| has finished. | 238 // Callback invoked when |bootstrap_user_context_initializer_| has finished. |
238 void OnBootstrapUserContextInitialized(bool success, | 239 void OnBootstrapUserContextInitialized(bool success, |
239 const UserContext& user_context); | 240 const UserContext& user_context); |
240 | 241 |
| 242 // Callback invoked when |oauth2_token_initializer_| has finished. |
| 243 void OnOAuth2TokensFetched(bool success, const UserContext& user_context); |
| 244 |
241 // Public session auto-login timer. | 245 // Public session auto-login timer. |
242 scoped_ptr<base::OneShotTimer<ExistingUserController> > auto_login_timer_; | 246 scoped_ptr<base::OneShotTimer<ExistingUserController> > auto_login_timer_; |
243 | 247 |
244 // Public session auto-login timeout, in milliseconds. | 248 // Public session auto-login timeout, in milliseconds. |
245 int public_session_auto_login_delay_; | 249 int public_session_auto_login_delay_; |
246 | 250 |
247 // Username for public session auto-login. | 251 // Username for public session auto-login. |
248 std::string public_session_auto_login_username_; | 252 std::string public_session_auto_login_username_; |
249 | 253 |
250 // Used to execute login operations. | 254 // Used to execute login operations. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 scoped_ptr<CrosSettings::ObserverSubscription> allow_guest_subscription_; | 322 scoped_ptr<CrosSettings::ObserverSubscription> allow_guest_subscription_; |
319 scoped_ptr<CrosSettings::ObserverSubscription> users_subscription_; | 323 scoped_ptr<CrosSettings::ObserverSubscription> users_subscription_; |
320 scoped_ptr<CrosSettings::ObserverSubscription> | 324 scoped_ptr<CrosSettings::ObserverSubscription> |
321 local_account_auto_login_id_subscription_; | 325 local_account_auto_login_id_subscription_; |
322 scoped_ptr<CrosSettings::ObserverSubscription> | 326 scoped_ptr<CrosSettings::ObserverSubscription> |
323 local_account_auto_login_delay_subscription_; | 327 local_account_auto_login_delay_subscription_; |
324 | 328 |
325 scoped_ptr<BootstrapUserContextInitializer> | 329 scoped_ptr<BootstrapUserContextInitializer> |
326 bootstrap_user_context_initializer_; | 330 bootstrap_user_context_initializer_; |
327 | 331 |
| 332 scoped_ptr<OAuth2TokenInitializer> oauth2_token_initializer_; |
| 333 |
328 FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerTest, ExistingUserLogin); | 334 FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerTest, ExistingUserLogin); |
329 | 335 |
330 // Factory of callbacks. | 336 // Factory of callbacks. |
331 base::WeakPtrFactory<ExistingUserController> weak_factory_; | 337 base::WeakPtrFactory<ExistingUserController> weak_factory_; |
332 | 338 |
333 DISALLOW_COPY_AND_ASSIGN(ExistingUserController); | 339 DISALLOW_COPY_AND_ASSIGN(ExistingUserController); |
334 }; | 340 }; |
335 | 341 |
336 } // namespace chromeos | 342 } // namespace chromeos |
337 | 343 |
338 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ | 344 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ |
OLD | NEW |