Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Side by Side Diff: chrome/browser/chromeos/login/signin/oauth2_login_verifier.cc

Issue 1129463004: Let Ubertoken Fetch be primed with an access token. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ChromeOS sends access token to GCMS Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/signin/core/browser/gaia_cookie_manager_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 if (cookie_manager_service_->ListAccounts(&accounts)) { 47 if (cookie_manager_service_->ListAccounts(&accounts)) {
48 OnGaiaAccountsInCookieUpdated( 48 OnGaiaAccountsInCookieUpdated(
49 accounts, GoogleServiceAuthError(GoogleServiceAuthError::NONE)); 49 accounts, GoogleServiceAuthError(GoogleServiceAuthError::NONE));
50 } 50 }
51 } 51 }
52 52
53 void OAuth2LoginVerifier::VerifyProfileTokens(Profile* profile) { 53 void OAuth2LoginVerifier::VerifyProfileTokens(Profile* profile) {
54 DCHECK_CURRENTLY_ON(BrowserThread::UI); 54 DCHECK_CURRENTLY_ON(BrowserThread::UI);
55 55
56 // TODO(xiyuan,mlerman): Use |access_token_| to cut down one round trip. 56 // TODO(xiyuan,mlerman): Use |access_token_| to cut down one round trip.
57 // See http://crbug.com/483596 57 // See http://crbug.com/483596
xiyuan 2015/05/06 18:43:16 nit: Remove the TODO?
Mike Lerman 2015/05/06 19:24:02 Done.
58 cookie_manager_service_->AddAccountToCookie(primary_account_id_); 58 cookie_manager_service_->AddAccountToCookieWithToken(primary_account_id_,
59 access_token_);
59 } 60 }
60 61
61 void OAuth2LoginVerifier::OnAddAccountToCookieCompleted( 62 void OAuth2LoginVerifier::OnAddAccountToCookieCompleted(
62 const std::string& account_id, 63 const std::string& account_id,
63 const GoogleServiceAuthError& error) { 64 const GoogleServiceAuthError& error) {
64 if (account_id != primary_account_id_) 65 if (account_id != primary_account_id_)
65 return; 66 return;
66 67
67 if (error.state() == GoogleServiceAuthError::State::NONE) { 68 if (error.state() == GoogleServiceAuthError::State::NONE) {
68 VLOG(1) << "MergeSession successful."; 69 VLOG(1) << "MergeSession successful.";
(...skipping 14 matching lines...) Expand all
83 delegate_->OnListAccountsSuccess(accounts); 84 delegate_->OnListAccountsSuccess(accounts);
84 return; 85 return;
85 } 86 }
86 87
87 LOG(WARNING) << "Failed to get list of session accounts, " 88 LOG(WARNING) << "Failed to get list of session accounts, "
88 << " error: " << error.state(); 89 << " error: " << error.state();
89 delegate_->OnListAccountsFailure(IsConnectionOrServiceError(error)); 90 delegate_->OnListAccountsFailure(IsConnectionOrServiceError(error));
90 } 91 }
91 92
92 } // namespace chromeos 93 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | components/signin/core/browser/gaia_cookie_manager_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698