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 "chrome/browser/chromeos/login/signin/oauth2_login_verifier.h" | 5 #include "chrome/browser/chromeos/login/signin/oauth2_login_verifier.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 base::Bind(&Delegate::OnSessionMergeFailure, | 142 base::Bind(&Delegate::OnSessionMergeFailure, |
143 base::Unretained(delegate_))); | 143 base::Unretained(delegate_))); |
144 } | 144 } |
145 | 145 |
146 void OAuth2LoginVerifier::StartMergeSession() { | 146 void OAuth2LoginVerifier::StartMergeSession() { |
147 DCHECK(!gaia_token_.empty()); | 147 DCHECK(!gaia_token_.empty()); |
148 gaia_fetcher_.reset( | 148 gaia_fetcher_.reset( |
149 new GaiaAuthFetcher(this, | 149 new GaiaAuthFetcher(this, |
150 std::string(GaiaConstants::kChromeOSSource), | 150 std::string(GaiaConstants::kChromeOSSource), |
151 user_request_context_.get())); | 151 user_request_context_.get())); |
152 gaia_fetcher_->StartMergeSession(gaia_token_); | 152 gaia_fetcher_->StartMergeSession(gaia_token_, std::string()); |
153 } | 153 } |
154 | 154 |
155 void OAuth2LoginVerifier::OnMergeSessionSuccess(const std::string& data) { | 155 void OAuth2LoginVerifier::OnMergeSessionSuccess(const std::string& data) { |
156 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 156 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
157 VLOG(1) << "MergeSession successful."; | 157 VLOG(1) << "MergeSession successful."; |
158 delegate_->OnSessionMergeSuccess(); | 158 delegate_->OnSessionMergeSuccess(); |
159 // Schedule post-merge verification to analyze how many LSID/SID overruns | 159 // Schedule post-merge verification to analyze how many LSID/SID overruns |
160 // were created by the session restore. | 160 // were created by the session restore. |
161 SchedulePostMergeVerification(); | 161 SchedulePostMergeVerification(); |
162 } | 162 } |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 << operation_id; | 263 << operation_id; |
264 UMA_HISTOGRAM_ENUMERATION( | 264 UMA_HISTOGRAM_ENUMERATION( |
265 base::StringPrintf("OAuth2Login.%sFailure", operation_id), | 265 base::StringPrintf("OAuth2Login.%sFailure", operation_id), |
266 error.state(), | 266 error.state(), |
267 GoogleServiceAuthError::NUM_STATES); | 267 GoogleServiceAuthError::NUM_STATES); |
268 | 268 |
269 error_handler.Run(IsConnectionOrServiceError(error)); | 269 error_handler.Run(IsConnectionOrServiceError(error)); |
270 } | 270 } |
271 | 271 |
272 } // namespace chromeos | 272 } // namespace chromeos |
OLD | NEW |