Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Side by Side Diff: components/autofill/core/browser/autofill_field.cc

Issue 1814883002: [Autofill] Check for full state name and abbreviation when determining types to upload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_field.h" 5 #include "components/autofill/core/browser/autofill_field.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/string_search.h" 10 #include "base/i18n/string_search.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 field->value = field->option_values[i]; 132 field->value = field->option_values[i];
133 return true; 133 return true;
134 } 134 }
135 } 135 }
136 136
137 return false; 137 return false;
138 } 138 }
139 139
140 bool FillStateSelectControl(const base::string16& value, 140 bool FillStateSelectControl(const base::string16& value,
141 FormFieldData* field) { 141 FormFieldData* field) {
142 base::string16 full, abbreviation; 142 base::string16 full;
143 base::string16 abbreviation;
143 state_names::GetNameAndAbbreviation(value, &full, &abbreviation); 144 state_names::GetNameAndAbbreviation(value, &full, &abbreviation);
144 145
145 // Try an exact match of the abbreviation first. 146 // Try an exact match of the abbreviation first.
146 if (!abbreviation.empty() && SetSelectControlValue(abbreviation, field)) { 147 if (!abbreviation.empty() && SetSelectControlValue(abbreviation, field)) {
147 return true; 148 return true;
148 } 149 }
149 150
150 // Try an exact match of the full name. 151 // Try an exact match of the full name.
151 if (!full.empty() && SetSelectControlValue(full, field)) { 152 if (!full.empty() && SetSelectControlValue(full, field)) {
152 return true; 153 return true;
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 } 646 }
646 return best_match; 647 return best_match;
647 } 648 }
648 649
649 bool AutofillField::IsCreditCardPrediction() const { 650 bool AutofillField::IsCreditCardPrediction() const {
650 return AutofillType(server_type_).group() == CREDIT_CARD || 651 return AutofillType(server_type_).group() == CREDIT_CARD ||
651 AutofillType(heuristic_type_).group() == CREDIT_CARD; 652 AutofillType(heuristic_type_).group() == CREDIT_CARD;
652 } 653 }
653 654
654 } // namespace autofill 655 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698