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

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

Issue 622773002: [Autofill] Autofill fails to show suggestions for credit card split across fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unit-tests. Created 6 years, 2 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 #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 <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 const std::string& app_locale, 82 const std::string& app_locale,
83 FormFieldData* field_data); 83 FormFieldData* field_data);
84 84
85 // Returns the phone number value for the given |field|. The returned value 85 // Returns the phone number value for the given |field|. The returned value
86 // might be |number|, or could possibly be a prefix or suffix of |number| 86 // might be |number|, or could possibly be a prefix or suffix of |number|
87 // if that's appropriate for the field. 87 // if that's appropriate for the field.
88 static base::string16 GetPhoneNumberValue(const AutofillField& field, 88 static base::string16 GetPhoneNumberValue(const AutofillField& field,
89 const base::string16& number, 89 const base::string16& number,
90 const FormFieldData& field_data); 90 const FormFieldData& field_data);
91 91
92 // Returns the credit card number value for the given |field|. The returned
93 // value might be |number|, or possibly an appropriate substring of |number|
94 // for cases where credit card number splits across multiple HTML form input
95 // fields.
96 static base::string16 GetCreditCardNumberValue(const AutofillField& field,
97 const base::string16& number);
98
92 private: 99 private:
93 // The unique name of this field, generated by Autofill. 100 // The unique name of this field, generated by Autofill.
94 base::string16 unique_name_; 101 base::string16 unique_name_;
95 102
96 // The unique identifier for the section (e.g. billing vs. shipping address) 103 // The unique identifier for the section (e.g. billing vs. shipping address)
97 // that this field belongs to. 104 // that this field belongs to.
98 std::string section_; 105 std::string section_;
99 106
100 // The type of the field, as determined by the Autofill server. 107 // The type of the field, as determined by the Autofill server.
101 ServerFieldType server_type_; 108 ServerFieldType server_type_;
(...skipping 20 matching lines...) Expand all
122 // Used to hold the position of the first digit to be copied as a substring 129 // Used to hold the position of the first digit to be copied as a substring
123 // from credit card number. 130 // from credit card number.
124 size_t credit_card_number_offset_; 131 size_t credit_card_number_offset_;
125 132
126 DISALLOW_COPY_AND_ASSIGN(AutofillField); 133 DISALLOW_COPY_AND_ASSIGN(AutofillField);
127 }; 134 };
128 135
129 } // namespace autofill 136 } // namespace autofill
130 137
131 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ 138 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_
OLDNEW
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_field.cc » ('j') | components/autofill/core/browser/autofill_field.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698