OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // A GoogleServiceAuthError is immutable, plain old data representing an | 5 // A GoogleServiceAuthError is immutable, plain old data representing an |
6 // error from an attempt to authenticate with a Google service. | 6 // error from an attempt to authenticate with a Google service. |
7 // It could be from Google Accounts itself, or any service using Google | 7 // It could be from Google Accounts itself, or any service using Google |
8 // Accounts (e.g expired credentials). It may contain additional data such as | 8 // Accounts (e.g expired credentials). It may contain additional data such as |
9 // captcha challenges. | 9 // captcha challenges. |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // (avoids err_ = GoogleServiceAuthError(GoogleServiceAuthError::NONE), due | 118 // (avoids err_ = GoogleServiceAuthError(GoogleServiceAuthError::NONE), due |
119 // to explicit class and State enum relation. Note: shouldn't be inlined! | 119 // to explicit class and State enum relation. Note: shouldn't be inlined! |
120 static const GoogleServiceAuthError None() { | 120 static const GoogleServiceAuthError None() { |
121 static const GoogleServiceAuthError e(NONE); | 121 static const GoogleServiceAuthError e(NONE); |
122 return e; | 122 return e; |
123 } | 123 } |
124 | 124 |
125 // The error information. | 125 // The error information. |
126 const State& state() const { return state_; } | 126 const State& state() const { return state_; } |
127 const Captcha& captcha() const { return captcha_; } | 127 const Captcha& captcha() const { return captcha_; } |
128 const int network_error() const { | 128 int network_error() const { |
129 return network_error_; | 129 return network_error_; |
130 } | 130 } |
131 | 131 |
132 private: | 132 private: |
133 GoogleServiceAuthError(State s, int error) | 133 GoogleServiceAuthError(State s, int error) |
134 : state_(s), | 134 : state_(s), |
135 captcha_("", GURL(), GURL()), | 135 captcha_("", GURL(), GURL()), |
136 network_error_(error) { | 136 network_error_(error) { |
137 } | 137 } |
138 | 138 |
139 GoogleServiceAuthError(State s, const std::string& captcha_token, | 139 GoogleServiceAuthError(State s, const std::string& captcha_token, |
140 const GURL& captcha_image_url, | 140 const GURL& captcha_image_url, |
141 const GURL& captcha_unlock_url) | 141 const GURL& captcha_unlock_url) |
142 : state_(s), | 142 : state_(s), |
143 captcha_(captcha_token, captcha_image_url, captcha_unlock_url), | 143 captcha_(captcha_token, captcha_image_url, captcha_unlock_url), |
144 network_error_(0) { | 144 network_error_(0) { |
145 } | 145 } |
146 | 146 |
147 State state_; | 147 State state_; |
148 Captcha captcha_; | 148 Captcha captcha_; |
149 int network_error_; | 149 int network_error_; |
150 }; | 150 }; |
151 | 151 |
152 #endif // CHROME_COMMON_NET_GAIA_GOOGLE_SERVICE_AUTH_ERROR_H_ | 152 #endif // CHROME_COMMON_NET_GAIA_GOOGLE_SERVICE_AUTH_ERROR_H_ |
OLD | NEW |