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_LOGIN_STATUS_CONSUMER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_STATUS_CONSUMER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_STATUS_CONSUMER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_STATUS_CONSUMER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "google_apis/gaia/gaia_auth_consumer.h" | 11 #include "google_apis/gaia/gaia_auth_consumer.h" |
12 #include "google_apis/gaia/google_service_auth_error.h" | 12 #include "google_apis/gaia/google_service_auth_error.h" |
13 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 | 16 |
| 17 struct UserCredentials; |
| 18 |
17 class LoginFailure { | 19 class LoginFailure { |
18 public: | 20 public: |
19 enum FailureReason { | 21 enum FailureReason { |
20 NONE, | 22 NONE, |
21 COULD_NOT_MOUNT_CRYPTOHOME, | 23 COULD_NOT_MOUNT_CRYPTOHOME, |
22 COULD_NOT_MOUNT_TMPFS, | 24 COULD_NOT_MOUNT_TMPFS, |
23 COULD_NOT_UNMOUNT_CRYPTOHOME, | 25 COULD_NOT_UNMOUNT_CRYPTOHOME, |
24 DATA_REMOVAL_FAILED, // Could not destroy your old data | 26 DATA_REMOVAL_FAILED, // Could not destroy your old data |
25 LOGIN_TIMED_OUT, | 27 LOGIN_TIMED_OUT, |
26 UNLOCK_FAILED, | 28 UNLOCK_FAILED, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 class LoginStatusConsumer { | 110 class LoginStatusConsumer { |
109 public: | 111 public: |
110 virtual ~LoginStatusConsumer() {} | 112 virtual ~LoginStatusConsumer() {} |
111 // The current login attempt has ended in failure, with error |error|. | 113 // The current login attempt has ended in failure, with error |error|. |
112 virtual void OnLoginFailure(const LoginFailure& error) = 0; | 114 virtual void OnLoginFailure(const LoginFailure& error) = 0; |
113 | 115 |
114 // The current retail mode login attempt has succeeded. | 116 // The current retail mode login attempt has succeeded. |
115 // Unless overridden for special processing, this should always call | 117 // Unless overridden for special processing, this should always call |
116 // OnLoginSuccess with the magic |kRetailModeUserEMail| constant. | 118 // OnLoginSuccess with the magic |kRetailModeUserEMail| constant. |
117 virtual void OnRetailModeLoginSuccess(); | 119 virtual void OnRetailModeLoginSuccess(); |
118 // The current login attempt has succeeded for | 120 // The current login attempt has succeeded for |credentials|. |
119 // |username|/|password|. If |pending_requests| is false, we're totally done. | 121 // If |pending_requests| is false, we're totally done. |
120 // If it's true, we will still have some more results to report later. | 122 // If it's true, we will still have some more results to report later. |
121 virtual void OnLoginSuccess( | 123 virtual void OnLoginSuccess( |
122 const std::string& username, | 124 const UserCredentials& credentials, |
123 const std::string& password, | |
124 bool pending_requests, | 125 bool pending_requests, |
125 bool using_oauth) = 0; | 126 bool using_oauth) = 0; |
126 // The current guest login attempt has succeeded. | 127 // The current guest login attempt has succeeded. |
127 virtual void OnOffTheRecordLoginSuccess() {} | 128 virtual void OnOffTheRecordLoginSuccess() {} |
128 // The same password didn't work both online and offline. | 129 // The same password didn't work both online and offline. |
129 virtual void OnPasswordChangeDetected(); | 130 virtual void OnPasswordChangeDetected(); |
130 }; | 131 }; |
131 | 132 |
132 } // namespace chromeos | 133 } // namespace chromeos |
133 | 134 |
134 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_STATUS_CONSUMER_H_ | 135 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_STATUS_CONSUMER_H_ |
OLD | NEW |