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

Side by Side Diff: chrome/browser/signin/google_auto_login_helper.cc

Issue 131973004: Eliminate usage of PO2TS::GetPrimaryAccountID() in UbertokenFetcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/signin/google_auto_login_helper.h" 5 #include "chrome/browser/signin/google_auto_login_helper.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/profiles/profile_manager.h" 8 #include "chrome/browser/profiles/profile_manager.h"
9 #include "google_apis/gaia/gaia_auth_fetcher.h" 9 #include "google_apis/gaia/gaia_auth_fetcher.h"
10 #include "google_apis/gaia/gaia_constants.h" 10 #include "google_apis/gaia/gaia_constants.h"
11 11
12 GoogleAutoLoginHelper::GoogleAutoLoginHelper(Profile* profile) 12 GoogleAutoLoginHelper::GoogleAutoLoginHelper(Profile* profile)
13 : profile_(profile) {} 13 : profile_(profile) {}
14 14
15 GoogleAutoLoginHelper::~GoogleAutoLoginHelper() { 15 GoogleAutoLoginHelper::~GoogleAutoLoginHelper() {
16 DCHECK(accounts_.empty()); 16 DCHECK(accounts_.empty());
17 } 17 }
18 18
19 void GoogleAutoLoginHelper::LogIn() {
20 // This is the code path for non-mirror world.
21 uber_token_fetcher_.reset(CreateNewUbertokenFetcher());
22 uber_token_fetcher_->StartFetchingToken();
23 DCHECK(accounts_.empty());
24 }
25
26 void GoogleAutoLoginHelper::LogIn(const std::string& account_id) { 19 void GoogleAutoLoginHelper::LogIn(const std::string& account_id) {
27 if (uber_token_fetcher_.get()) { 20 if (uber_token_fetcher_.get()) {
blundell 2014/01/09 16:44:07 Is there anything I can do to preserve the DCHECK
Roger Tawa OOO till Jul 10th 2014/01/10 00:08:14 No need. When I land https://codereview.chromium.
28 accounts_.push_back(account_id); 21 accounts_.push_back(account_id);
29 } else { 22 } else {
30 uber_token_fetcher_.reset(CreateNewUbertokenFetcher()); 23 uber_token_fetcher_.reset(CreateNewUbertokenFetcher());
31 uber_token_fetcher_->StartFetchingToken(account_id); 24 uber_token_fetcher_->StartFetchingToken(account_id);
32 } 25 }
33 } 26 }
34 27
35 void GoogleAutoLoginHelper::OnUbertokenSuccess(const std::string& uber_token) { 28 void GoogleAutoLoginHelper::OnUbertokenSuccess(const std::string& uber_token) {
36 VLOG(1) << "GoogleAutoLoginHelper::OnUbertokenSuccess"; 29 VLOG(1) << "GoogleAutoLoginHelper::OnUbertokenSuccess";
37 gaia_auth_fetcher_.reset(CreateNewGaiaAuthFetcher()); 30 gaia_auth_fetcher_.reset(CreateNewGaiaAuthFetcher());
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 74
82 UbertokenFetcher* GoogleAutoLoginHelper::CreateNewUbertokenFetcher() { 75 UbertokenFetcher* GoogleAutoLoginHelper::CreateNewUbertokenFetcher() {
83 return new UbertokenFetcher(profile_, this); 76 return new UbertokenFetcher(profile_, this);
84 } 77 }
85 78
86 GaiaAuthFetcher* GoogleAutoLoginHelper::CreateNewGaiaAuthFetcher() { 79 GaiaAuthFetcher* GoogleAutoLoginHelper::CreateNewGaiaAuthFetcher() {
87 return new GaiaAuthFetcher( 80 return new GaiaAuthFetcher(
88 this, GaiaConstants::kChromeSource, profile_->GetRequestContext()); 81 this, GaiaConstants::kChromeSource, profile_->GetRequestContext());
89 } 82 }
90 83
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698