| 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_PARALLEL_AUTHENTICATOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 DEMO_LOGIN, // Logged in as the demo user. | 60 DEMO_LOGIN, // Logged in as the demo user. |
| 61 ONLINE_LOGIN, // Offline and online login succeeded. | 61 ONLINE_LOGIN, // Offline and online login succeeded. |
| 62 UNLOCK, // Screen unlock succeeded. | 62 UNLOCK, // Screen unlock succeeded. |
| 63 ONLINE_FAILED, // Online login disallowed, but offline succeeded. | 63 ONLINE_FAILED, // Online login disallowed, but offline succeeded. |
| 64 GUEST_LOGIN, // Logged in guest mode. | 64 GUEST_LOGIN, // Logged in guest mode. |
| 65 LOGIN_FAILED, // Login denied. | 65 LOGIN_FAILED, // Login denied. |
| 66 OWNER_REQUIRED // Login is restricted to the owner only. | 66 OWNER_REQUIRED // Login is restricted to the owner only. |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 explicit ParallelAuthenticator(LoginStatusConsumer* consumer); | 69 explicit ParallelAuthenticator(LoginStatusConsumer* consumer); |
| 70 virtual ~ParallelAuthenticator(); | |
| 71 | 70 |
| 72 // Authenticator overrides. | 71 // Authenticator overrides. |
| 73 virtual void CompleteLogin(Profile* profile, | 72 virtual void CompleteLogin(Profile* profile, |
| 74 const std::string& username, | 73 const std::string& username, |
| 75 const std::string& password) OVERRIDE; | 74 const std::string& password) OVERRIDE; |
| 76 | 75 |
| 77 // Given a |username| and |password|, this method attempts to authenticate to | 76 // Given a |username| and |password|, this method attempts to authenticate to |
| 78 // the Google accounts servers and your Chrome OS device simultaneously. | 77 // the Google accounts servers and your Chrome OS device simultaneously. |
| 79 // As soon as we have successfully mounted the encrypted home directory for | 78 // As soon as we have successfully mounted the encrypted home directory for |
| 80 // |username|, we will call consumer_->OnLoginSuccess() with |username| and a | 79 // |username|, we will call consumer_->OnLoginSuccess() with |username| and a |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // the state we have gathered at the time of call. If a decision | 137 // the state we have gathered at the time of call. If a decision |
| 139 // can't be made, defers until the next time this is called. | 138 // can't be made, defers until the next time this is called. |
| 140 // When a decision is made, will call back to |consumer_| on the UI thread. | 139 // When a decision is made, will call back to |consumer_| on the UI thread. |
| 141 // | 140 // |
| 142 // Must be called on the UI thread. | 141 // Must be called on the UI thread. |
| 143 virtual void Resolve() OVERRIDE; | 142 virtual void Resolve() OVERRIDE; |
| 144 | 143 |
| 145 void OnOffTheRecordLoginSuccess(); | 144 void OnOffTheRecordLoginSuccess(); |
| 146 void OnPasswordChangeDetected(); | 145 void OnPasswordChangeDetected(); |
| 147 | 146 |
| 147 protected: |
| 148 virtual ~ParallelAuthenticator(); |
| 149 |
| 148 private: | 150 private: |
| 149 friend class ParallelAuthenticatorTest; | 151 friend class ParallelAuthenticatorTest; |
| 150 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, | 152 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, |
| 151 ResolveOwnerNeededDirectFailedMount); | 153 ResolveOwnerNeededDirectFailedMount); |
| 152 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ResolveOwnerNeededMount); | 154 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ResolveOwnerNeededMount); |
| 153 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, | 155 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, |
| 154 ResolveOwnerNeededFailedMount); | 156 ResolveOwnerNeededFailedMount); |
| 155 | 157 |
| 156 // Returns the AuthState we're in, given the status info we have at | 158 // Returns the AuthState we're in, given the status info we have at |
| 157 // the time of call. | 159 // the time of call. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 258 |
| 257 // True if we use OAuth-based authentication flow. | 259 // True if we use OAuth-based authentication flow. |
| 258 bool using_oauth_; | 260 bool using_oauth_; |
| 259 | 261 |
| 260 DISALLOW_COPY_AND_ASSIGN(ParallelAuthenticator); | 262 DISALLOW_COPY_AND_ASSIGN(ParallelAuthenticator); |
| 261 }; | 263 }; |
| 262 | 264 |
| 263 } // namespace chromeos | 265 } // namespace chromeos |
| 264 | 266 |
| 265 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ | 267 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ |
| OLD | NEW |