OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/about_signin_internals.h" | 5 #include "components/signin/core/browser/about_signin_internals.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 token_details->Append(token_info); | 657 token_details->Append(token_info); |
658 } | 658 } |
659 } | 659 } |
660 | 660 |
661 base::ListValue* account_info = new base::ListValue(); | 661 base::ListValue* account_info = new base::ListValue(); |
662 signin_status->Set("accountInfo", account_info); | 662 signin_status->Set("accountInfo", account_info); |
663 const std::vector<std::string>& accounts_in_token_service = | 663 const std::vector<std::string>& accounts_in_token_service = |
664 token_service->GetAccounts(); | 664 token_service->GetAccounts(); |
665 | 665 |
666 if(accounts_in_token_service.size() == 0) { | 666 if(accounts_in_token_service.size() == 0) { |
667 base::DictionaryValue* no_token_entry = new base::DictionaryValue(); | 667 std::unique_ptr<base::DictionaryValue> no_token_entry( |
| 668 new base::DictionaryValue()); |
668 no_token_entry->SetString("accountId", "No token in Token Service."); | 669 no_token_entry->SetString("accountId", "No token in Token Service."); |
669 account_info->Append(no_token_entry); | 670 account_info->Append(std::move(no_token_entry)); |
670 } | 671 } |
671 | 672 |
672 for(const std::string& account_id : accounts_in_token_service) { | 673 for(const std::string& account_id : accounts_in_token_service) { |
673 base::DictionaryValue* entry = new base::DictionaryValue(); | 674 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue()); |
674 entry->SetString("accountId", account_id); | 675 entry->SetString("accountId", account_id); |
675 account_info->Append(entry); | 676 account_info->Append(std::move(entry)); |
676 } | 677 } |
677 | 678 |
678 return signin_status; | 679 return signin_status; |
679 } | 680 } |
OLD | NEW |