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

Side by Side Diff: components/signin/core/browser/account_tracker_service.cc

Issue 1256283002: GAIA ID migration for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: full version Created 5 years, 4 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
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 "components/signin/core/browser/account_tracker_service.h" 5 #include "components/signin/core/browser/account_tracker_service.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/prefs/scoped_user_pref_update.h" 10 #include "base/prefs/scoped_user_pref_update.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 AccountState& state = accounts_[account_id]; 259 AccountState& state = accounts_[account_id];
260 if (state.info.is_child_account == is_child_account) 260 if (state.info.is_child_account == is_child_account)
261 return; 261 return;
262 state.info.is_child_account = is_child_account; 262 state.info.is_child_account = is_child_account;
263 if (state.info.IsValid()) 263 if (state.info.IsValid())
264 NotifyAccountUpdated(state); 264 NotifyAccountUpdated(state);
265 SaveToPrefs(state); 265 SaveToPrefs(state);
266 } 266 }
267 267
268 bool AccountTrackerService::IsMigratable() { 268 bool AccountTrackerService::IsMigratable() {
269 #if !defined(OS_IOS) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) 269 #if !defined(OS_IOS) && !defined(OS_CHROMEOS)
270 for (std::map<std::string, AccountState>::const_iterator it = 270 for (std::map<std::string, AccountState>::const_iterator it =
271 accounts_.begin(); 271 accounts_.begin();
272 it != accounts_.end(); ++it) { 272 it != accounts_.end(); ++it) {
273 const AccountState& state = it->second; 273 const AccountState& state = it->second;
274 if ((it->first).empty() || state.info.gaia.empty()) 274 if ((it->first).empty() || state.info.gaia.empty())
275 return false; 275 return false;
276 } 276 }
277 return true; 277 return true;
278 #else 278 #else
279 return false; 279 return false;
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 if(!ContainsKey(accounts_, info.account_id)) { 507 if(!ContainsKey(accounts_, info.account_id)) {
508 SeedAccountInfo(info.gaia, info.email); 508 SeedAccountInfo(info.gaia, info.email);
509 } 509 }
510 510
511 AccountState& state = accounts_[info.account_id]; 511 AccountState& state = accounts_[info.account_id];
512 state.info = info; 512 state.info = info;
513 NotifyAccountUpdated(state); 513 NotifyAccountUpdated(state);
514 SaveToPrefs(state); 514 SaveToPrefs(state);
515 } 515 }
516 } 516 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698