Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 |
| OLD | NEW |