OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromeos/login/auth/online_attempt.h" | 5 #include "chromeos/login/auth/online_attempt.h" |
6 | 6 |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 TriggerResolve(AuthFailure::FromNetworkAuthFailure(error)); | 108 TriggerResolve(AuthFailure::FromNetworkAuthFailure(error)); |
109 } | 109 } |
110 | 110 |
111 void OnlineAttempt::TryClientLogin() { | 111 void OnlineAttempt::TryClientLogin() { |
112 message_loop_->PostDelayedTask( | 112 message_loop_->PostDelayedTask( |
113 FROM_HERE, | 113 FROM_HERE, |
114 base::Bind(&OnlineAttempt::CancelClientLogin, weak_factory_.GetWeakPtr()), | 114 base::Bind(&OnlineAttempt::CancelClientLogin, weak_factory_.GetWeakPtr()), |
115 base::TimeDelta::FromMilliseconds(kClientLoginTimeoutMs)); | 115 base::TimeDelta::FromMilliseconds(kClientLoginTimeoutMs)); |
116 | 116 |
117 client_fetcher_->StartClientLogin( | 117 client_fetcher_->StartClientLogin( |
118 attempt_->user_context.GetUserID(), | 118 attempt_->user_context.GetUserID().GetUserEmail(), |
119 attempt_->user_context.GetKey()->GetSecret(), | 119 attempt_->user_context.GetKey()->GetSecret(), |
120 GaiaConstants::kSyncService, | 120 GaiaConstants::kSyncService, |
121 attempt_->login_token, | 121 attempt_->login_token, |
122 attempt_->login_captcha, | 122 attempt_->login_captcha, |
123 attempt_->hosted_policy()); | 123 attempt_->hosted_policy()); |
124 } | 124 } |
125 | 125 |
126 bool OnlineAttempt::HasPendingFetch() { | 126 bool OnlineAttempt::HasPendingFetch() { |
127 return client_fetcher_->HasPendingFetch(); | 127 return client_fetcher_->HasPendingFetch(); |
128 } | 128 } |
(...skipping 11 matching lines...) Expand all Loading... |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 void OnlineAttempt::TriggerResolve(const AuthFailure& outcome) { | 143 void OnlineAttempt::TriggerResolve(const AuthFailure& outcome) { |
144 attempt_->RecordOnlineLoginStatus(outcome); | 144 attempt_->RecordOnlineLoginStatus(outcome); |
145 client_fetcher_.reset(NULL); | 145 client_fetcher_.reset(NULL); |
146 resolver_->Resolve(); | 146 resolver_->Resolve(); |
147 } | 147 } |
148 | 148 |
149 } // namespace chromeos | 149 } // namespace chromeos |
OLD | NEW |