| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROMEOS_LOGIN_AUTH_ONLINE_ATTEMPT_H_ | 5 #ifndef CHROMEOS_LOGIN_AUTH_ONLINE_ATTEMPT_H_ |
| 6 #define CHROMEOS_LOGIN_AUTH_ONLINE_ATTEMPT_H_ | 6 #define CHROMEOS_LOGIN_AUTH_ONLINE_ATTEMPT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 virtual ~OnlineAttempt(); | 34 virtual ~OnlineAttempt(); |
| 35 | 35 |
| 36 // Initiate the online login attempt either through client or auth login. | 36 // Initiate the online login attempt either through client or auth login. |
| 37 // Status will be recorded in |current_attempt|, and resolver_->Resolve() will | 37 // Status will be recorded in |current_attempt|, and resolver_->Resolve() will |
| 38 // be called on the IO thread when useful state is available. | 38 // be called on the IO thread when useful state is available. |
| 39 // Must be called on the UI thread. | 39 // Must be called on the UI thread. |
| 40 void Initiate(net::URLRequestContextGetter* request_context); | 40 void Initiate(net::URLRequestContextGetter* request_context); |
| 41 | 41 |
| 42 // GaiaAuthConsumer overrides. Callbacks from GaiaAuthFetcher | 42 // GaiaAuthConsumer overrides. Callbacks from GaiaAuthFetcher |
| 43 virtual void OnClientLoginFailure( | 43 virtual void OnClientLoginFailure( |
| 44 const GoogleServiceAuthError& error) OVERRIDE; | 44 const GoogleServiceAuthError& error) override; |
| 45 virtual void OnClientLoginSuccess( | 45 virtual void OnClientLoginSuccess( |
| 46 const GaiaAuthConsumer::ClientLoginResult& credentials) OVERRIDE; | 46 const GaiaAuthConsumer::ClientLoginResult& credentials) override; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 FRIEND_TEST_ALL_PREFIXES(OnlineAttemptTest, LoginSuccess); | 49 FRIEND_TEST_ALL_PREFIXES(OnlineAttemptTest, LoginSuccess); |
| 50 FRIEND_TEST_ALL_PREFIXES(OnlineAttemptTest, TwoFactorSuccess); | 50 FRIEND_TEST_ALL_PREFIXES(OnlineAttemptTest, TwoFactorSuccess); |
| 51 | 51 |
| 52 // Milliseconds until we timeout our attempt to hit ClientLogin. | 52 // Milliseconds until we timeout our attempt to hit ClientLogin. |
| 53 static const int kClientLoginTimeoutMs; | 53 static const int kClientLoginTimeoutMs; |
| 54 | 54 |
| 55 void TryClientLogin(); | 55 void TryClientLogin(); |
| 56 void CancelClientLogin(); | 56 void CancelClientLogin(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 74 // Used to cancel the CancelClientLogin closure. | 74 // Used to cancel the CancelClientLogin closure. |
| 75 base::WeakPtrFactory<OnlineAttempt> weak_factory_; | 75 base::WeakPtrFactory<OnlineAttempt> weak_factory_; |
| 76 | 76 |
| 77 friend class OnlineAttemptTest; | 77 friend class OnlineAttemptTest; |
| 78 DISALLOW_COPY_AND_ASSIGN(OnlineAttempt); | 78 DISALLOW_COPY_AND_ASSIGN(OnlineAttempt); |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace chromeos | 81 } // namespace chromeos |
| 82 | 82 |
| 83 #endif // CHROMEOS_LOGIN_AUTH_ONLINE_ATTEMPT_H_ | 83 #endif // CHROMEOS_LOGIN_AUTH_ONLINE_ATTEMPT_H_ |
| OLD | NEW |