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 #include "chrome/browser/chromeos/login/online_attempt.h" | 5 #include "chrome/browser/chromeos/login/online_attempt.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 if (using_oauth_) { | 164 if (using_oauth_) { |
165 if (!attempt_->oauth1_access_token().length() || | 165 if (!attempt_->oauth1_access_token().length() || |
166 !attempt_->oauth1_access_secret().length()) { | 166 !attempt_->oauth1_access_secret().length()) { |
167 // Empty OAuth1 access token and secret probably means that we are | 167 // Empty OAuth1 access token and secret probably means that we are |
168 // dealing with a legacy ChromeOS account. This should be treated as | 168 // dealing with a legacy ChromeOS account. This should be treated as |
169 // invalid/expired token. | 169 // invalid/expired token. |
170 OnClientLoginFailure(GoogleServiceAuthError( | 170 OnClientLoginFailure(GoogleServiceAuthError( |
171 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS)); | 171 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS)); |
172 } else { | 172 } else { |
173 oauth_fetcher_->StartOAuthLogin(GaiaConstants::kChromeOSSource, | 173 oauth_fetcher_->StartOAuthLogin(GaiaConstants::kChromeOSSource, |
174 GaiaConstants::kPicasaService, | 174 GaiaConstants::kSyncService, |
175 attempt_->oauth1_access_token(), | 175 attempt_->oauth1_access_token(), |
176 attempt_->oauth1_access_secret()); | 176 attempt_->oauth1_access_secret()); |
177 } | 177 } |
178 } else { | 178 } else { |
179 client_fetcher_->StartClientLogin( | 179 client_fetcher_->StartClientLogin( |
180 attempt_->username, | 180 attempt_->username, |
181 attempt_->password, | 181 attempt_->password, |
182 GaiaConstants::kPicasaService, | 182 GaiaConstants::kSyncService, |
183 attempt_->login_token, | 183 attempt_->login_token, |
184 attempt_->login_captcha, | 184 attempt_->login_captcha, |
185 attempt_->hosted_policy()); | 185 attempt_->hosted_policy()); |
186 } | 186 } |
187 } | 187 } |
188 | 188 |
189 bool OnlineAttempt::HasPendingFetch() { | 189 bool OnlineAttempt::HasPendingFetch() { |
190 return using_oauth_ ? oauth_fetcher_->HasPendingFetch() : | 190 return using_oauth_ ? oauth_fetcher_->HasPendingFetch() : |
191 client_fetcher_->HasPendingFetch(); | 191 client_fetcher_->HasPendingFetch(); |
192 } | 192 } |
(...skipping 14 matching lines...) Expand all Loading... |
207 | 207 |
208 void OnlineAttempt::TriggerResolve( | 208 void OnlineAttempt::TriggerResolve( |
209 const LoginFailure& outcome) { | 209 const LoginFailure& outcome) { |
210 attempt_->RecordOnlineLoginStatus(outcome); | 210 attempt_->RecordOnlineLoginStatus(outcome); |
211 client_fetcher_.reset(NULL); | 211 client_fetcher_.reset(NULL); |
212 oauth_fetcher_.reset(NULL); | 212 oauth_fetcher_.reset(NULL); |
213 resolver_->Resolve(); | 213 resolver_->Resolve(); |
214 } | 214 } |
215 | 215 |
216 } // namespace chromeos | 216 } // namespace chromeos |
OLD | NEW |