OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 oauth_fetcher_->CancelRequest(); | 56 oauth_fetcher_->CancelRequest(); |
57 } | 57 } |
58 | 58 |
59 void OnlineAttempt::Initiate(Profile* auth_profile) { | 59 void OnlineAttempt::Initiate(Profile* auth_profile) { |
60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
61 if (using_oauth_) { | 61 if (using_oauth_) { |
62 oauth_fetcher_.reset( | 62 oauth_fetcher_.reset( |
63 new GaiaOAuthFetcher(this, | 63 new GaiaOAuthFetcher(this, |
64 auth_profile->GetRequestContext(), | 64 auth_profile->GetRequestContext(), |
65 auth_profile, | 65 auth_profile, |
| 66 GaiaConstants::kSyncService, |
66 kServiceScopeChromeOS)); | 67 kServiceScopeChromeOS)); |
67 } else { | 68 } else { |
68 client_fetcher_.reset( | 69 client_fetcher_.reset( |
69 new GaiaAuthFetcher(this, GaiaConstants::kChromeOSSource, | 70 new GaiaAuthFetcher(this, GaiaConstants::kChromeOSSource, |
70 auth_profile->GetRequestContext())); | 71 auth_profile->GetRequestContext())); |
71 } | 72 } |
72 BrowserThread::PostTask( | 73 BrowserThread::PostTask( |
73 BrowserThread::IO, FROM_HERE, | 74 BrowserThread::IO, FROM_HERE, |
74 NewRunnableMethod(this, &OnlineAttempt::TryClientLogin)); | 75 NewRunnableMethod(this, &OnlineAttempt::TryClientLogin)); |
75 } | 76 } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 void OnlineAttempt::TriggerResolve( | 215 void OnlineAttempt::TriggerResolve( |
215 const GaiaAuthConsumer::ClientLoginResult& credentials, | 216 const GaiaAuthConsumer::ClientLoginResult& credentials, |
216 const LoginFailure& outcome) { | 217 const LoginFailure& outcome) { |
217 attempt_->RecordOnlineLoginStatus(credentials, outcome); | 218 attempt_->RecordOnlineLoginStatus(credentials, outcome); |
218 client_fetcher_.reset(NULL); | 219 client_fetcher_.reset(NULL); |
219 oauth_fetcher_.reset(NULL); | 220 oauth_fetcher_.reset(NULL); |
220 resolver_->Resolve(); | 221 resolver_->Resolve(); |
221 } | 222 } |
222 | 223 |
223 } // namespace chromeos | 224 } // namespace chromeos |
OLD | NEW |