| 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> |
| 10 |
| 9 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 10 #include "base/hash.h" | 12 #include "base/hash.h" |
| 11 #include "base/i18n/time_formatting.h" | 13 #include "base/i18n/time_formatting.h" |
| 12 #include "base/logging.h" | 14 #include "base/logging.h" |
| 13 #include "base/profiler/scoped_tracker.h" | 15 #include "base/profiler/scoped_tracker.h" |
| 14 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/trace_event/trace_event.h" | 18 #include "base/trace_event/trace_event.h" |
| 17 #include "build/build_config.h" | 19 #include "build/build_config.h" |
| 18 #include "components/pref_registry/pref_registry_syncable.h" | 20 #include "components/pref_registry/pref_registry_syncable.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 35 return base::UTF16ToUTF8(base::TimeFormatShortDateAndTime(time)); | 37 return base::UTF16ToUTF8(base::TimeFormatShortDateAndTime(time)); |
| 36 } | 38 } |
| 37 | 39 |
| 38 base::ListValue* AddSection(base::ListValue* parent_list, | 40 base::ListValue* AddSection(base::ListValue* parent_list, |
| 39 const std::string& title) { | 41 const std::string& title) { |
| 40 std::unique_ptr<base::DictionaryValue> section(new base::DictionaryValue()); | 42 std::unique_ptr<base::DictionaryValue> section(new base::DictionaryValue()); |
| 41 base::ListValue* section_contents = new base::ListValue(); | 43 base::ListValue* section_contents = new base::ListValue(); |
| 42 | 44 |
| 43 section->SetString("title", title); | 45 section->SetString("title", title); |
| 44 section->Set("data", section_contents); | 46 section->Set("data", section_contents); |
| 45 parent_list->Append(section.release()); | 47 parent_list->Append(std::move(section)); |
| 46 return section_contents; | 48 return section_contents; |
| 47 } | 49 } |
| 48 | 50 |
| 49 void AddSectionEntry(base::ListValue* section_list, | 51 void AddSectionEntry(base::ListValue* section_list, |
| 50 const std::string& field_name, | 52 const std::string& field_name, |
| 51 const std::string& field_status, | 53 const std::string& field_status, |
| 52 const std::string& field_time = "") { | 54 const std::string& field_time = "") { |
| 53 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue()); | 55 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue()); |
| 54 entry->SetString("label", field_name); | 56 entry->SetString("label", field_name); |
| 55 entry->SetString("status", field_status); | 57 entry->SetString("status", field_status); |
| 56 entry->SetString("time", field_time); | 58 entry->SetString("time", field_time); |
| 57 section_list->Append(entry.release()); | 59 section_list->Append(std::move(entry)); |
| 58 } | 60 } |
| 59 | 61 |
| 60 void AddCookieEntry(base::ListValue* accounts_list, | 62 void AddCookieEntry(base::ListValue* accounts_list, |
| 61 const std::string& field_email, | 63 const std::string& field_email, |
| 62 const std::string& field_gaia_id, | 64 const std::string& field_gaia_id, |
| 63 const std::string& field_valid) { | 65 const std::string& field_valid) { |
| 64 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue()); | 66 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue()); |
| 65 entry->SetString("email", field_email); | 67 entry->SetString("email", field_email); |
| 66 entry->SetString("gaia_id", field_gaia_id); | 68 entry->SetString("gaia_id", field_gaia_id); |
| 67 entry->SetString("valid", field_valid); | 69 entry->SetString("valid", field_valid); |
| 68 accounts_list->Append(entry.release()); | 70 accounts_list->Append(std::move(entry)); |
| 69 } | 71 } |
| 70 | 72 |
| 71 std::string SigninStatusFieldToLabel(UntimedSigninStatusField field) { | 73 std::string SigninStatusFieldToLabel(UntimedSigninStatusField field) { |
| 72 switch (field) { | 74 switch (field) { |
| 73 case ACCOUNT_ID: | 75 case ACCOUNT_ID: |
| 74 return "Account Id"; | 76 return "Account Id"; |
| 75 case GAIA_ID: | 77 case GAIA_ID: |
| 76 return "Gaia Id"; | 78 return "Gaia Id"; |
| 77 case USERNAME: | 79 case USERNAME: |
| 78 return "Username"; | 80 return "Username"; |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 } | 670 } |
| 669 | 671 |
| 670 for(const std::string& account_id : accounts_in_token_service) { | 672 for(const std::string& account_id : accounts_in_token_service) { |
| 671 base::DictionaryValue* entry = new base::DictionaryValue(); | 673 base::DictionaryValue* entry = new base::DictionaryValue(); |
| 672 entry->SetString("accountId", account_id); | 674 entry->SetString("accountId", account_id); |
| 673 account_info->Append(entry); | 675 account_info->Append(entry); |
| 674 } | 676 } |
| 675 | 677 |
| 676 return signin_status; | 678 return signin_status; |
| 677 } | 679 } |
| OLD | NEW |