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

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

Issue 63253003: Fix issues with token refresh in AccountReconcilor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wip Created 7 years, 1 month 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
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 "base/json/json_reader.h" 5 #include "base/json/json_reader.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/net/chrome_cookie_notification_details.h" 9 #include "chrome/browser/net/chrome_cookie_notification_details.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 void AccountReconcilor::OnCookieChanged(ChromeCookieDetails* details) { 142 void AccountReconcilor::OnCookieChanged(ChromeCookieDetails* details) {
143 // TODO(acleung): Filter out cookies by looking at the domain. 143 // TODO(acleung): Filter out cookies by looking at the domain.
144 // StartReconcileAction(); 144 // StartReconcileAction();
145 } 145 }
146 146
147 void AccountReconcilor::OnRefreshTokenAvailable(const std::string& account_id) { 147 void AccountReconcilor::OnRefreshTokenAvailable(const std::string& account_id) {
148 DVLOG(1) << "AccountReconcilor::OnRefreshTokenAvailable: " << account_id; 148 DVLOG(1) << "AccountReconcilor::OnRefreshTokenAvailable: " << account_id;
149 PerformMergeAction(account_id); 149 PerformMergeAction(account_id);
150 } 150 }
151 151
152 void AccountReconcilor::OnRefreshTokenAvailable(
153 const std::deque<std::string>& account_ids) {
154 PerformMergeAction(account_ids);
155 }
Roger Tawa OOO till Jul 10th 2013/11/08 13:17:31 I don't think its a good idea to declare a new cal
156
152 void AccountReconcilor::OnRefreshTokenRevoked(const std::string& account_id) { 157 void AccountReconcilor::OnRefreshTokenRevoked(const std::string& account_id) {
153 DVLOG(1) << "AccountReconcilor::OnRefreshTokenRevoked: " << account_id; 158 DVLOG(1) << "AccountReconcilor::OnRefreshTokenRevoked: " << account_id;
154 PerformRemoveAction(account_id); 159 PerformRemoveAction(account_id);
155 } 160 }
156 161
157 void AccountReconcilor::OnRefreshTokensLoaded() {} 162 void AccountReconcilor::OnRefreshTokensLoaded() {}
158 163
159 void AccountReconcilor::PerformMergeAction(const std::string& account_id) { 164 void AccountReconcilor::PerformMergeAction(const std::string& account_id) {
160 // GoogleAutoLoginHelper deletes itself upon success / failure. 165 // GoogleAutoLoginHelper deletes itself upon success / failure.
161 GoogleAutoLoginHelper* helper = new GoogleAutoLoginHelper(profile_); 166 GoogleAutoLoginHelper* helper = new GoogleAutoLoginHelper(profile_);
162 helper->LogIn(account_id); 167 helper->LogIn(account_id);
163 } 168 }
164 169
170 void AccountReconcilor::PerformMergeAction(
171 const std::deque<std::string>& account_ids) {
172 // GoogleAutoLoginHelper deletes itself upon success / failure.
173 GoogleAutoLoginHelper* helper = new GoogleAutoLoginHelper(profile_);
174 helper->LogIn(account_ids);
175 }
Roger Tawa OOO till Jul 10th 2013/11/08 13:17:31 If you change the helper so that LogIn(std::string
acleung1 2013/11/08 22:21:48 In that case, wouldn't I need to do a lot more wor
176
165 void AccountReconcilor::PerformRemoveAction(const std::string& account_id) { 177 void AccountReconcilor::PerformRemoveAction(const std::string& account_id) {
166 // TODO(acleung): Implement this: 178 // TODO(acleung): Implement this:
167 } 179 }
168 180
169 void AccountReconcilor::StartReconcileAction() { 181 void AccountReconcilor::StartReconcileAction() {
170 if (!IsProfileConnected()) 182 if (!IsProfileConnected())
171 return; 183 return;
172 184
173 // Reset state for validating gaia cookie. 185 // Reset state for validating gaia cookie.
174 are_gaia_accounts_set_ = false; 186 are_gaia_accounts_set_ = false;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 have_same_accounts = false; 325 have_same_accounts = false;
314 break; 326 break;
315 } 327 }
316 } 328 }
317 } 329 }
318 330
319 if (!are_primaries_equal || !have_same_accounts) { 331 if (!are_primaries_equal || !have_same_accounts) {
320 // TODO(rogerta): fix things up. 332 // TODO(rogerta): fix things up.
321 } 333 }
322 } 334 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/account_reconcilor.h ('k') | chrome/browser/signin/android_profile_oauth2_token_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698