Chromium Code Reviews| 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 void set_default_value(const std::string& value) { default_value_ = value; } | 75 void set_default_value(const std::string& value) { default_value_ = value; } |
| 76 const std::string& default_value() const { return default_value_; } | 76 const std::string& default_value() const { return default_value_; } |
| 77 | 77 |
| 78 void set_credit_card_number_offset(size_t position) { | 78 void set_credit_card_number_offset(size_t position) { |
| 79 credit_card_number_offset_ = position; | 79 credit_card_number_offset_ = position; |
| 80 } | 80 } |
| 81 size_t credit_card_number_offset() const { | 81 size_t credit_card_number_offset() const { |
| 82 return credit_card_number_offset_; | 82 return credit_card_number_offset_; |
| 83 } | 83 } |
| 84 | 84 |
| 85 PasswordGenerationEvent generation_event() const { return generation_event_; } | |
|
vabr (Chromium)
2016/02/17 13:43:22
nit: All the other getter-setter pairs have the or
dvadym
2016/02/19 16:25:05
Done.
| |
| 86 void set_generation_event(PasswordGenerationEvent event) { | |
| 87 generation_event_ = event; | |
| 88 } | |
| 89 | |
| 85 // Set |field_data|'s value to |value|. Uses |field|, |address_language_code|, | 90 // Set |field_data|'s value to |value|. Uses |field|, |address_language_code|, |
| 86 // and |app_locale| as hints when filling exceptional cases like phone number | 91 // and |app_locale| as hints when filling exceptional cases like phone number |
| 87 // values and <select> fields. Returns |true| if the field has been filled, | 92 // values and <select> fields. Returns |true| if the field has been filled, |
| 88 // |false| otherwise. | 93 // |false| otherwise. |
| 89 static bool FillFormField(const AutofillField& field, | 94 static bool FillFormField(const AutofillField& field, |
| 90 const base::string16& value, | 95 const base::string16& value, |
| 91 const std::string& address_language_code, | 96 const std::string& address_language_code, |
| 92 const std::string& app_locale, | 97 const std::string& app_locale, |
| 93 FormFieldData* field_data); | 98 FormFieldData* field_data); |
| 94 | 99 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 size_t credit_card_number_offset_; | 146 size_t credit_card_number_offset_; |
| 142 | 147 |
| 143 // Whether the field was autofilled then later edited. | 148 // Whether the field was autofilled then later edited. |
| 144 bool previously_autofilled_; | 149 bool previously_autofilled_; |
| 145 | 150 |
| 146 // The parseable name attribute, with unnecessary information removed (such as | 151 // The parseable name attribute, with unnecessary information removed (such as |
| 147 // a common prefix shared with other fields). Will be used for heuristics | 152 // a common prefix shared with other fields). Will be used for heuristics |
| 148 // parsing. | 153 // parsing. |
| 149 base::string16 parseable_name_; | 154 base::string16 parseable_name_; |
| 150 | 155 |
| 156 // The type of password generation event, if it happened. | |
| 157 PasswordGenerationEvent generation_event_; | |
| 158 | |
| 151 DISALLOW_COPY_AND_ASSIGN(AutofillField); | 159 DISALLOW_COPY_AND_ASSIGN(AutofillField); |
| 152 }; | 160 }; |
| 153 | 161 |
| 154 } // namespace autofill | 162 } // namespace autofill |
| 155 | 163 |
| 156 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ | 164 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ |
| OLD | NEW |