| 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_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 Loading... |
| 436 | 436 |
| 437 } // namespace | 437 } // namespace |
| 438 | 438 |
| 439 AutofillField::AutofillField() | 439 AutofillField::AutofillField() |
| 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 generation_type_(NO_GENERATION) {} |
| 447 | 448 |
| 448 AutofillField::AutofillField(const FormFieldData& field, | 449 AutofillField::AutofillField(const FormFieldData& field, |
| 449 const base::string16& unique_name) | 450 const base::string16& unique_name) |
| 450 : FormFieldData(field), | 451 : FormFieldData(field), |
| 451 unique_name_(unique_name), | 452 unique_name_(unique_name), |
| 452 server_type_(NO_SERVER_DATA), | 453 server_type_(NO_SERVER_DATA), |
| 453 heuristic_type_(UNKNOWN_TYPE), | 454 heuristic_type_(UNKNOWN_TYPE), |
| 454 html_type_(HTML_TYPE_UNSPECIFIED), | 455 html_type_(HTML_TYPE_UNSPECIFIED), |
| 455 html_mode_(HTML_MODE_NONE), | 456 html_mode_(HTML_MODE_NONE), |
| 456 phone_part_(IGNORED), | 457 phone_part_(IGNORED), |
| 457 credit_card_number_offset_(0), | 458 credit_card_number_offset_(0), |
| 458 previously_autofilled_(false), | 459 previously_autofilled_(false), |
| 459 parseable_name_(field.name) {} | 460 parseable_name_(field.name), |
| 461 generation_type_(NO_GENERATION) {} |
| 460 | 462 |
| 461 AutofillField::~AutofillField() {} | 463 AutofillField::~AutofillField() {} |
| 462 | 464 |
| 463 void AutofillField::set_heuristic_type(ServerFieldType type) { | 465 void AutofillField::set_heuristic_type(ServerFieldType type) { |
| 464 if (type >= 0 && type < MAX_VALID_FIELD_TYPE && | 466 if (type >= 0 && type < MAX_VALID_FIELD_TYPE && |
| 465 type != FIELD_WITH_DEFAULT_VALUE) { | 467 type != FIELD_WITH_DEFAULT_VALUE) { |
| 466 heuristic_type_ = type; | 468 heuristic_type_ = type; |
| 467 } else { | 469 } else { |
| 468 NOTREACHED(); | 470 NOTREACHED(); |
| 469 // This case should not be reachable; but since this has potential | 471 // This case should not be reachable; but since this has potential |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 if (compare.StringsEqual(value_stripped, option_contents)) { | 626 if (compare.StringsEqual(value_stripped, option_contents)) { |
| 625 if (index) | 627 if (index) |
| 626 *index = i; | 628 *index = i; |
| 627 return true; | 629 return true; |
| 628 } | 630 } |
| 629 } | 631 } |
| 630 return false; | 632 return false; |
| 631 } | 633 } |
| 632 | 634 |
| 633 } // namespace autofill | 635 } // namespace autofill |
| OLD | NEW |