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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 const int OnlineAttempt::kClientLoginTimeoutMs = 10000; | 39 const int OnlineAttempt::kClientLoginTimeoutMs = 10000; |
40 | 40 |
41 OnlineAttempt::OnlineAttempt(bool using_oauth, | 41 OnlineAttempt::OnlineAttempt(bool using_oauth, |
42 AuthAttemptState* current_attempt, | 42 AuthAttemptState* current_attempt, |
43 AuthAttemptStateResolver* callback) | 43 AuthAttemptStateResolver* callback) |
44 : using_oauth_(using_oauth), | 44 : using_oauth_(using_oauth), |
45 attempt_(current_attempt), | 45 attempt_(current_attempt), |
46 resolver_(callback), | 46 resolver_(callback), |
47 weak_factory_(this), | 47 weak_factory_(this), |
48 try_again_(true) { | 48 try_again_(true) { |
49 CHECK(chromeos::CrosLibrary::Get()->EnsureLoaded()); | |
50 } | 49 } |
51 | 50 |
52 OnlineAttempt::~OnlineAttempt() { | 51 OnlineAttempt::~OnlineAttempt() { |
53 // Just to be sure. | 52 // Just to be sure. |
54 if (client_fetcher_.get()) | 53 if (client_fetcher_.get()) |
55 client_fetcher_->CancelRequest(); | 54 client_fetcher_->CancelRequest(); |
56 | 55 |
57 if (oauth_fetcher_.get()) | 56 if (oauth_fetcher_.get()) |
58 oauth_fetcher_->CancelRequest(); | 57 oauth_fetcher_->CancelRequest(); |
59 } | 58 } |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 void OnlineAttempt::TriggerResolve( | 209 void OnlineAttempt::TriggerResolve( |
211 const GaiaAuthConsumer::ClientLoginResult& credentials, | 210 const GaiaAuthConsumer::ClientLoginResult& credentials, |
212 const LoginFailure& outcome) { | 211 const LoginFailure& outcome) { |
213 attempt_->RecordOnlineLoginStatus(credentials, outcome); | 212 attempt_->RecordOnlineLoginStatus(credentials, outcome); |
214 client_fetcher_.reset(NULL); | 213 client_fetcher_.reset(NULL); |
215 oauth_fetcher_.reset(NULL); | 214 oauth_fetcher_.reset(NULL); |
216 resolver_->Resolve(); | 215 resolver_->Resolve(); |
217 } | 216 } |
218 | 217 |
219 } // namespace chromeos | 218 } // namespace chromeos |
OLD | NEW |