| OLD | NEW |
| 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 AccountState& state = accounts_[account_id]; | 247 AccountState& state = accounts_[account_id]; |
| 248 if (state.info.is_child_account == is_child_account) | 248 if (state.info.is_child_account == is_child_account) |
| 249 return; | 249 return; |
| 250 state.info.is_child_account = is_child_account; | 250 state.info.is_child_account = is_child_account; |
| 251 if (state.info.IsValid()) | 251 if (state.info.IsValid()) |
| 252 NotifyAccountUpdated(state); | 252 NotifyAccountUpdated(state); |
| 253 SaveToPrefs(state); | 253 SaveToPrefs(state); |
| 254 } | 254 } |
| 255 | 255 |
| 256 bool AccountTrackerService::IsMigratable() { | 256 bool AccountTrackerService::IsMigratable() { |
| 257 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 257 #if !defined(OS_CHROMEOS) |
| 258 for (std::map<std::string, AccountState>::const_iterator it = | 258 for (std::map<std::string, AccountState>::const_iterator it = |
| 259 accounts_.begin(); | 259 accounts_.begin(); |
| 260 it != accounts_.end(); ++it) { | 260 it != accounts_.end(); ++it) { |
| 261 const AccountState& state = it->second; | 261 const AccountState& state = it->second; |
| 262 if ((it->first).empty() || state.info.gaia.empty()) | 262 if ((it->first).empty() || state.info.gaia.empty()) |
| 263 return false; | 263 return false; |
| 264 } | 264 } |
| 265 return true; | 265 return true; |
| 266 #else | 266 #else |
| 267 return false; | 267 return false; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 if(!ContainsKey(accounts_, info.account_id)) { | 494 if(!ContainsKey(accounts_, info.account_id)) { |
| 495 SeedAccountInfo(info.gaia, info.email); | 495 SeedAccountInfo(info.gaia, info.email); |
| 496 } | 496 } |
| 497 | 497 |
| 498 AccountState& state = accounts_[info.account_id]; | 498 AccountState& state = accounts_[info.account_id]; |
| 499 state.info = info; | 499 state.info = info; |
| 500 NotifyAccountUpdated(state); | 500 NotifyAccountUpdated(state); |
| 501 SaveToPrefs(state); | 501 SaveToPrefs(state); |
| 502 } | 502 } |
| 503 } | 503 } |
| 504 |
| 505 void AccountTrackerService::RemoveAccount(const std::string& account_id) { |
| 506 StopTrackingAccount(account_id); |
| 507 } |
| OLD | NEW |