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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 return false; | 1076 return false; |
1077 } | 1077 } |
1078 | 1078 |
1079 // If any of the names on the card or the addresses don't match (where | 1079 // If any of the names on the card or the addresses don't match (where |
1080 // matching is case insensitive and ignores middle initials if present), the | 1080 // matching is case insensitive and ignores middle initials if present), the |
1081 // candidate set is invalid. This matches the rules for name matching applied | 1081 // candidate set is invalid. This matches the rules for name matching applied |
1082 // server-side by Google Payments and ensures that we don't send upload | 1082 // server-side by Google Payments and ensures that we don't send upload |
1083 // requests that are guaranteed to fail. | 1083 // requests that are guaranteed to fail. |
1084 base::string16 verified_name; | 1084 base::string16 verified_name; |
1085 base::string16 card_name = | 1085 base::string16 card_name = |
1086 card.GetInfo(AutofillType(CREDIT_CARD_NAME), app_locale_); | 1086 card.GetInfo(AutofillType(CREDIT_CARD_NAME_FULL), app_locale_); |
1087 if (!card_name.empty()) { | 1087 if (!card_name.empty()) { |
1088 verified_name = RemoveMiddleInitial(card_name); | 1088 verified_name = RemoveMiddleInitial(card_name); |
1089 } | 1089 } |
1090 for (const AutofillProfile& profile : candidate_profiles) { | 1090 for (const AutofillProfile& profile : candidate_profiles) { |
1091 base::string16 address_name = | 1091 base::string16 address_name = |
1092 profile.GetInfo(AutofillType(NAME_FULL), app_locale_); | 1092 profile.GetInfo(AutofillType(NAME_FULL), app_locale_); |
1093 if (!address_name.empty()) { | 1093 if (!address_name.empty()) { |
1094 if (verified_name.empty()) { | 1094 if (verified_name.empty()) { |
1095 verified_name = RemoveMiddleInitial(address_name); | 1095 verified_name = RemoveMiddleInitial(address_name); |
1096 } else { | 1096 } else { |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1831 if (i > 0) | 1831 if (i > 0) |
1832 fputs("Next oldest form:\n", file); | 1832 fputs("Next oldest form:\n", file); |
1833 } | 1833 } |
1834 fputs("\n", file); | 1834 fputs("\n", file); |
1835 | 1835 |
1836 fclose(file); | 1836 fclose(file); |
1837 } | 1837 } |
1838 #endif // ENABLE_FORM_DEBUG_DUMP | 1838 #endif // ENABLE_FORM_DEBUG_DUMP |
1839 | 1839 |
1840 } // namespace autofill | 1840 } // namespace autofill |
OLD | NEW |