| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 public: | 22 public: |
| 23 enum FailureReason { | 23 enum FailureReason { |
| 24 NONE, | 24 NONE, |
| 25 COULD_NOT_MOUNT_CRYPTOHOME, | 25 COULD_NOT_MOUNT_CRYPTOHOME, |
| 26 COULD_NOT_MOUNT_TMPFS, | 26 COULD_NOT_MOUNT_TMPFS, |
| 27 COULD_NOT_UNMOUNT_CRYPTOHOME, | 27 COULD_NOT_UNMOUNT_CRYPTOHOME, |
| 28 DATA_REMOVAL_FAILED, // Could not destroy your old data | 28 DATA_REMOVAL_FAILED, // Could not destroy your old data |
| 29 LOGIN_TIMED_OUT, | 29 LOGIN_TIMED_OUT, |
| 30 UNLOCK_FAILED, | 30 UNLOCK_FAILED, |
| 31 NETWORK_AUTH_FAILED, // Could not authenticate against Google | 31 NETWORK_AUTH_FAILED, // Could not authenticate against Google |
| 32 OWNER_REQUIRED, // Only the device owner can log-in. |
| 32 NUM_FAILURE_REASONS, // This has to be the last item. | 33 NUM_FAILURE_REASONS, // This has to be the last item. |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 explicit LoginFailure(FailureReason reason) | 36 explicit LoginFailure(FailureReason reason) |
| 36 : reason_(reason), | 37 : reason_(reason), |
| 37 error_(GoogleServiceAuthError::NONE) { | 38 error_(GoogleServiceAuthError::NONE) { |
| 38 DCHECK(reason != NETWORK_AUTH_FAILED); | 39 DCHECK(reason != NETWORK_AUTH_FAILED); |
| 39 } | 40 } |
| 40 | 41 |
| 41 inline bool operator==(const LoginFailure &b) const { | 42 inline bool operator==(const LoginFailure &b) const { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 69 return "Could not mount tmpfs."; | 70 return "Could not mount tmpfs."; |
| 70 case LOGIN_TIMED_OUT: | 71 case LOGIN_TIMED_OUT: |
| 71 return "Login timed out. Please try again."; | 72 return "Login timed out. Please try again."; |
| 72 case UNLOCK_FAILED: | 73 case UNLOCK_FAILED: |
| 73 return "Unlock failed."; | 74 return "Unlock failed."; |
| 74 case NETWORK_AUTH_FAILED: | 75 case NETWORK_AUTH_FAILED: |
| 75 if (error_.state() == GoogleServiceAuthError::CONNECTION_FAILED) { | 76 if (error_.state() == GoogleServiceAuthError::CONNECTION_FAILED) { |
| 76 return net::ErrorToString(error_.network_error()); | 77 return net::ErrorToString(error_.network_error()); |
| 77 } | 78 } |
| 78 return "Google authentication failed."; | 79 return "Google authentication failed."; |
| 80 case OWNER_REQUIRED: |
| 81 return "Login is restricted to the owner's account only."; |
| 79 default: | 82 default: |
| 80 NOTREACHED(); | 83 NOTREACHED(); |
| 81 return std::string(); | 84 return std::string(); |
| 82 } | 85 } |
| 83 } | 86 } |
| 84 | 87 |
| 85 const GoogleServiceAuthError& error() const { return error_; } | 88 const GoogleServiceAuthError& error() const { return error_; } |
| 86 const FailureReason& reason() const { return reason_; } | 89 const FailureReason& reason() const { return reason_; } |
| 87 | 90 |
| 88 private: | 91 private: |
| (...skipping 29 matching lines...) Expand all Loading... |
| 118 bool using_oauth) = 0; | 121 bool using_oauth) = 0; |
| 119 // The current guest login attempt has succeeded. | 122 // The current guest login attempt has succeeded. |
| 120 virtual void OnOffTheRecordLoginSuccess() {} | 123 virtual void OnOffTheRecordLoginSuccess() {} |
| 121 // The same password didn't work both online and offline. | 124 // The same password didn't work both online and offline. |
| 122 virtual void OnPasswordChangeDetected(); | 125 virtual void OnPasswordChangeDetected(); |
| 123 }; | 126 }; |
| 124 | 127 |
| 125 } // namespace chromeos | 128 } // namespace chromeos |
| 126 | 129 |
| 127 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_STATUS_CONSUMER_H_ | 130 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_STATUS_CONSUMER_H_ |
| OLD | NEW |