| 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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 "dump-autofill-data"); | 1050 "dump-autofill-data"); |
| 1051 | 1051 |
| 1052 // Save the form data for future dumping. | 1052 // Save the form data for future dumping. |
| 1053 if (dump_data) { | 1053 if (dump_data) { |
| 1054 if (recently_autofilled_forms_.size() > 5) | 1054 if (recently_autofilled_forms_.size() > 5) |
| 1055 recently_autofilled_forms_.erase(recently_autofilled_forms_.begin()); | 1055 recently_autofilled_forms_.erase(recently_autofilled_forms_.begin()); |
| 1056 | 1056 |
| 1057 recently_autofilled_forms_.push_back( | 1057 recently_autofilled_forms_.push_back( |
| 1058 std::map<std::string, base::string16>()); | 1058 std::map<std::string, base::string16>()); |
| 1059 auto& map = recently_autofilled_forms_.back(); | 1059 auto& map = recently_autofilled_forms_.back(); |
| 1060 for (const auto& field : submitted_form) { | 1060 for (const auto* field : submitted_form) { |
| 1061 AutofillType type = field->Type(); | 1061 AutofillType type = field->Type(); |
| 1062 // Even though this is for development only, mask full credit card #'s. | 1062 // Even though this is for development only, mask full credit card #'s. |
| 1063 if (type.GetStorableType() == CREDIT_CARD_NUMBER && | 1063 if (type.GetStorableType() == CREDIT_CARD_NUMBER && |
| 1064 field->value.size() > 4) { | 1064 field->value.size() > 4) { |
| 1065 map[type.ToString()] = base::ASCIIToUTF16("...(omitted)...") + | 1065 map[type.ToString()] = base::ASCIIToUTF16("...(omitted)...") + |
| 1066 field->value.substr(field->value.size() - 4, 4); | 1066 field->value.substr(field->value.size() - 4, 4); |
| 1067 } else { | 1067 } else { |
| 1068 map[type.ToString()] = field->value; | 1068 map[type.ToString()] = field->value; |
| 1069 } | 1069 } |
| 1070 } | 1070 } |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2047 if (i > 0) | 2047 if (i > 0) |
| 2048 fputs("Next oldest form:\n", file); | 2048 fputs("Next oldest form:\n", file); |
| 2049 } | 2049 } |
| 2050 fputs("\n", file); | 2050 fputs("\n", file); |
| 2051 | 2051 |
| 2052 fclose(file); | 2052 fclose(file); |
| 2053 } | 2053 } |
| 2054 #endif // ENABLE_FORM_DEBUG_DUMP | 2054 #endif // ENABLE_FORM_DEBUG_DUMP |
| 2055 | 2055 |
| 2056 } // namespace autofill | 2056 } // namespace autofill |
| OLD | NEW |