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

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

Issue 1622073002: [Autofill] Remove longest common prefix from field names when running heuristics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests Created 4 years, 11 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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 AutofillField::AutofillField(const FormFieldData& field, 436 AutofillField::AutofillField(const FormFieldData& field,
437 const base::string16& unique_name) 437 const base::string16& unique_name)
438 : FormFieldData(field), 438 : FormFieldData(field),
439 unique_name_(unique_name), 439 unique_name_(unique_name),
440 server_type_(NO_SERVER_DATA), 440 server_type_(NO_SERVER_DATA),
441 heuristic_type_(UNKNOWN_TYPE), 441 heuristic_type_(UNKNOWN_TYPE),
442 html_type_(HTML_TYPE_UNSPECIFIED), 442 html_type_(HTML_TYPE_UNSPECIFIED),
443 html_mode_(HTML_MODE_NONE), 443 html_mode_(HTML_MODE_NONE),
444 phone_part_(IGNORED), 444 phone_part_(IGNORED),
445 credit_card_number_offset_(0), 445 credit_card_number_offset_(0),
446 previously_autofilled_(false) {} 446 previously_autofilled_(false),
447 parseable_name_(field.name) {}
447 448
448 AutofillField::~AutofillField() {} 449 AutofillField::~AutofillField() {}
449 450
450 void AutofillField::set_heuristic_type(ServerFieldType type) { 451 void AutofillField::set_heuristic_type(ServerFieldType type) {
451 if (type >= 0 && type < MAX_VALID_FIELD_TYPE && 452 if (type >= 0 && type < MAX_VALID_FIELD_TYPE &&
452 type != FIELD_WITH_DEFAULT_VALUE) { 453 type != FIELD_WITH_DEFAULT_VALUE) {
453 heuristic_type_ = type; 454 heuristic_type_ = type;
454 } else { 455 } else {
455 NOTREACHED(); 456 NOTREACHED();
456 // This case should not be reachable; but since this has potential 457 // This case should not be reachable; but since this has potential
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 if (compare.StringsEqual(value_stripped, option_contents)) { 597 if (compare.StringsEqual(value_stripped, option_contents)) {
597 if (index) 598 if (index)
598 *index = i; 599 *index = i;
599 return true; 600 return true;
600 } 601 }
601 } 602 }
602 return false; 603 return false;
603 } 604 }
604 605
605 } // namespace autofill 606 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698