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

Unified Diff: chrome/browser/signin/account_reconcilor.cc

Issue 110373007: Delay loading the NTP after sign in until MergeSession has been performed in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo in chromeos 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/signin/account_reconcilor.h ('k') | chrome/browser/signin/account_reconcilor_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/account_reconcilor.cc
diff --git a/chrome/browser/signin/account_reconcilor.cc b/chrome/browser/signin/account_reconcilor.cc
index 053382b85f5852d5d535fd6ed700fddc9faeb128..27a3cbd04d12786ef45b9ba5ff354920a6aa8e76 100644
--- a/chrome/browser/signin/account_reconcilor.cc
+++ b/chrome/browser/signin/account_reconcilor.cc
@@ -10,7 +10,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/net/chrome_cookie_notification_details.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/signin/google_auto_login_helper.h"
#include "chrome/browser/signin/profile_oauth2_token_service.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager.h"
@@ -79,9 +78,9 @@ void AccountReconcilor::UserIdFetcher::OnNetworkError(int response_code) {
AccountReconcilor::AccountReconcilor(Profile* profile)
: OAuth2TokenService::Consumer("account_reconcilor"),
profile_(profile),
+ merge_session_helper_(profile, NULL),
registered_with_token_service_(false),
- are_gaia_accounts_set_(false),
- requests_(NULL) {
+ are_gaia_accounts_set_(false),requests_(NULL) {
DVLOG(1) << "AccountReconcilor::AccountReconcilor";
RegisterWithSigninManager();
RegisterWithCookieMonster();
@@ -105,6 +104,7 @@ AccountReconcilor::~AccountReconcilor() {
void AccountReconcilor::Shutdown() {
DVLOG(1) << "AccountReconcilor::Shutdown";
+ merge_session_helper_.CancelAll();
DeleteAccessTokenRequestsAndUserIdFetchers();
UnregisterWithSigninManager();
UnregisterWithTokenService();
@@ -112,6 +112,16 @@ void AccountReconcilor::Shutdown() {
StopPeriodicReconciliation();
}
+void AccountReconcilor::AddMergeSessionObserver(
+ GoogleAutoLoginHelper::Observer* observer) {
+ merge_session_helper_.AddObserver(observer);
+}
+
+void AccountReconcilor::RemoveMergeSessionObserver(
+ GoogleAutoLoginHelper::Observer* observer) {
+ merge_session_helper_.RemoveObserver(observer);
+}
+
void AccountReconcilor::DeleteAccessTokenRequestsAndUserIdFetchers() {
delete[] requests_;
requests_ = NULL;
@@ -237,9 +247,7 @@ void AccountReconcilor::OnRefreshTokenRevoked(const std::string& account_id) {
void AccountReconcilor::OnRefreshTokensLoaded() {}
void AccountReconcilor::PerformMergeAction(const std::string& account_id) {
- // GoogleAutoLoginHelper deletes itself upon success / failure.
- GoogleAutoLoginHelper* helper = new GoogleAutoLoginHelper(profile_);
- helper->LogIn(account_id);
+ merge_session_helper_.LogIn(account_id);
}
void AccountReconcilor::PerformRemoveAction(const std::string& account_id) {
« no previous file with comments | « chrome/browser/signin/account_reconcilor.h ('k') | chrome/browser/signin/account_reconcilor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698