| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/autofill/core/browser/autofill_manager.h" | 5 #include "components/autofill/core/browser/autofill_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 "dump-autofill-data"); | 1019 "dump-autofill-data"); |
| 1020 | 1020 |
| 1021 // Save the form data for future dumping. | 1021 // Save the form data for future dumping. |
| 1022 if (dump_data) { | 1022 if (dump_data) { |
| 1023 if (recently_autofilled_forms_.size() > 5) | 1023 if (recently_autofilled_forms_.size() > 5) |
| 1024 recently_autofilled_forms_.erase(recently_autofilled_forms_.begin()); | 1024 recently_autofilled_forms_.erase(recently_autofilled_forms_.begin()); |
| 1025 | 1025 |
| 1026 recently_autofilled_forms_.push_back( | 1026 recently_autofilled_forms_.push_back( |
| 1027 std::map<std::string, base::string16>()); | 1027 std::map<std::string, base::string16>()); |
| 1028 auto& map = recently_autofilled_forms_.back(); | 1028 auto& map = recently_autofilled_forms_.back(); |
| 1029 for (const auto& field : submitted_form) { | 1029 for (auto* field : submitted_form) { |
| 1030 AutofillType type = field->Type(); | 1030 AutofillType type = field->Type(); |
| 1031 // Even though this is for development only, mask full credit card #'s. | 1031 // Even though this is for development only, mask full credit card #'s. |
| 1032 if (type.GetStorableType() == CREDIT_CARD_NUMBER && | 1032 if (type.GetStorableType() == CREDIT_CARD_NUMBER && |
| 1033 field->value.size() > 4) { | 1033 field->value.size() > 4) { |
| 1034 map[type.ToString()] = base::ASCIIToUTF16("...(omitted)...") + | 1034 map[type.ToString()] = base::ASCIIToUTF16("...(omitted)...") + |
| 1035 field->value.substr(field->value.size() - 4, 4); | 1035 field->value.substr(field->value.size() - 4, 4); |
| 1036 } else { | 1036 } else { |
| 1037 map[type.ToString()] = field->value; | 1037 map[type.ToString()] = field->value; |
| 1038 } | 1038 } |
| 1039 } | 1039 } |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2016 if (i > 0) | 2016 if (i > 0) |
| 2017 fputs("Next oldest form:\n", file); | 2017 fputs("Next oldest form:\n", file); |
| 2018 } | 2018 } |
| 2019 fputs("\n", file); | 2019 fputs("\n", file); |
| 2020 | 2020 |
| 2021 fclose(file); | 2021 fclose(file); |
| 2022 } | 2022 } |
| 2023 #endif // ENABLE_FORM_DEBUG_DUMP | 2023 #endif // ENABLE_FORM_DEBUG_DUMP |
| 2024 | 2024 |
| 2025 } // namespace autofill | 2025 } // namespace autofill |
| OLD | NEW |