| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 state.info.locale = base::UTF16ToUTF8(value); | 341 state.info.locale = base::UTF16ToUTF8(value); |
| 342 if (dict->GetString(kAccountPictureURLPath, &value)) | 342 if (dict->GetString(kAccountPictureURLPath, &value)) |
| 343 state.info.picture_url = base::UTF16ToUTF8(value); | 343 state.info.picture_url = base::UTF16ToUTF8(value); |
| 344 | 344 |
| 345 bool is_child_account = false; | 345 bool is_child_account = false; |
| 346 // Migrate deprecated service flag preference. | 346 // Migrate deprecated service flag preference. |
| 347 const base::ListValue* service_flags_list; | 347 const base::ListValue* service_flags_list; |
| 348 if (dict->GetList(kAccountServiceFlagsPath, &service_flags_list)) { | 348 if (dict->GetList(kAccountServiceFlagsPath, &service_flags_list)) { |
| 349 contains_deprecated_service_flags = true; | 349 contains_deprecated_service_flags = true; |
| 350 std::string flag_string; | 350 std::string flag_string; |
| 351 for (base::Value* flag : *service_flags_list) { | 351 for (const auto& flag : *service_flags_list) { |
| 352 if (flag->GetAsString(&flag_string) && | 352 if (flag->GetAsString(&flag_string) && |
| 353 flag_string == kChildAccountServiceFlag) { | 353 flag_string == kChildAccountServiceFlag) { |
| 354 is_child_account = true; | 354 is_child_account = true; |
| 355 break; | 355 break; |
| 356 } | 356 } |
| 357 } | 357 } |
| 358 state.info.is_child_account = is_child_account; | 358 state.info.is_child_account = is_child_account; |
| 359 } | 359 } |
| 360 if (dict->GetBoolean(kAccountChildAccountStatusPath, &is_child_account)) | 360 if (dict->GetBoolean(kAccountChildAccountStatusPath, &is_child_account)) |
| 361 state.info.is_child_account = is_child_account; | 361 state.info.is_child_account = is_child_account; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 NotifyAccountUpdated(state); | 501 NotifyAccountUpdated(state); |
| 502 } | 502 } |
| 503 SaveToPrefs(state); | 503 SaveToPrefs(state); |
| 504 } | 504 } |
| 505 return info.account_id; | 505 return info.account_id; |
| 506 } | 506 } |
| 507 | 507 |
| 508 void AccountTrackerService::RemoveAccount(const std::string& account_id) { | 508 void AccountTrackerService::RemoveAccount(const std::string& account_id) { |
| 509 StopTrackingAccount(account_id); | 509 StopTrackingAccount(account_id); |
| 510 } | 510 } |
| OLD | NEW |