OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <string> | 10 #include <string> |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 const webkit_glue::FormData& form, | 132 const webkit_glue::FormData& form, |
133 const webkit_glue::FormField& field, | 133 const webkit_glue::FormField& field, |
134 FormStructure** form_structure, | 134 FormStructure** form_structure, |
135 AutofillField** autofill_field) WARN_UNUSED_RESULT; | 135 AutofillField** autofill_field) WARN_UNUSED_RESULT; |
136 | 136 |
137 // Returns a list of values from the stored profiles that match |type| and the | 137 // Returns a list of values from the stored profiles that match |type| and the |
138 // value of |field| and returns the labels of the matching profiles. |labels| | 138 // value of |field| and returns the labels of the matching profiles. |labels| |
139 // is filled with the Profile label. | 139 // is filled with the Profile label. |
140 void GetProfileSuggestions(FormStructure* form, | 140 void GetProfileSuggestions(FormStructure* form, |
141 const webkit_glue::FormField& field, | 141 const webkit_glue::FormField& field, |
142 AutofillType type, | 142 AutofillFieldType type, |
143 std::vector<string16>* values, | 143 std::vector<string16>* values, |
144 std::vector<string16>* labels, | 144 std::vector<string16>* labels, |
145 std::vector<string16>* icons, | 145 std::vector<string16>* icons, |
146 std::vector<int>* unique_ids); | 146 std::vector<int>* unique_ids); |
147 | 147 |
148 // Returns a list of values from the stored credit cards that match |type| and | 148 // Returns a list of values from the stored credit cards that match |type| and |
149 // the value of |field| and returns the labels of the matching credit cards. | 149 // the value of |field| and returns the labels of the matching credit cards. |
150 void GetCreditCardSuggestions(FormStructure* form, | 150 void GetCreditCardSuggestions(FormStructure* form, |
151 const webkit_glue::FormField& field, | 151 const webkit_glue::FormField& field, |
152 AutofillType type, | 152 AutofillFieldType type, |
153 std::vector<string16>* values, | 153 std::vector<string16>* values, |
154 std::vector<string16>* labels, | 154 std::vector<string16>* labels, |
155 std::vector<string16>* icons, | 155 std::vector<string16>* icons, |
156 std::vector<int>* unique_ids); | 156 std::vector<int>* unique_ids); |
157 | 157 |
158 // Set |field| argument's value based on |type| and contents of the | 158 // Set |field| argument's value based on |type| and contents of the |
159 // |credit_card|. | 159 // |credit_card|. |
160 void FillCreditCardFormField(const CreditCard* credit_card, | 160 void FillCreditCardFormField(const CreditCard* credit_card, |
161 AutofillType type, | 161 AutofillFieldType type, |
162 webkit_glue::FormField* field); | 162 webkit_glue::FormField* field); |
163 | 163 |
164 // Set |field| argument's value based on |type| and contents of the |profile|. | 164 // Set |field| argument's value based on |type| and contents of the |profile|. |
165 void FillFormField(const AutofillProfile* profile, | 165 void FillFormField(const AutofillProfile* profile, |
166 AutofillType type, | 166 AutofillFieldType type, |
167 webkit_glue::FormField* field); | 167 webkit_glue::FormField* field); |
168 | 168 |
169 // Set |field| argument's value for phone/fax number based on contents of the | 169 // Set |field| argument's value for phone/fax number based on contents of the |
170 // |profile|. |type| is the type of the phone. | 170 // |profile|. |type| is the type of the phone. |
171 void FillPhoneNumberField(const AutofillProfile* profile, | 171 void FillPhoneNumberField(const AutofillProfile* profile, |
172 AutofillType type, | 172 AutofillFieldType type, |
173 webkit_glue::FormField* field); | 173 webkit_glue::FormField* field); |
174 | 174 |
175 // Parses the forms using heuristic matching and querying the Autofill server. | 175 // Parses the forms using heuristic matching and querying the Autofill server. |
176 void ParseForms(const std::vector<webkit_glue::FormData>& forms); | 176 void ParseForms(const std::vector<webkit_glue::FormData>& forms); |
177 | 177 |
178 // Uses existing personal data to determine possible field types for the | 178 // Uses existing personal data to determine possible field types for the |
179 // |submitted_form|. | 179 // |submitted_form|. |
180 void DeterminePossibleFieldTypesForUpload(FormStructure* submitted_form); | 180 void DeterminePossibleFieldTypesForUpload(FormStructure* submitted_form); |
181 | 181 |
182 // Logs quality metrics for the submitted |form|, which should be logically | 182 // Logs quality metrics for the submitted |form|, which should be logically |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, | 238 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, |
239 NoQualityMetricsForNonAutofillableForms); | 239 NoQualityMetricsForNonAutofillableForms); |
240 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, SaneMetricsWithCacheMismatch); | 240 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, SaneMetricsWithCacheMismatch); |
241 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, QualityMetricsForFailure); | 241 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, QualityMetricsForFailure); |
242 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, QualityMetricsWithExperimentId); | 242 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, QualityMetricsWithExperimentId); |
243 | 243 |
244 DISALLOW_COPY_AND_ASSIGN(AutofillManager); | 244 DISALLOW_COPY_AND_ASSIGN(AutofillManager); |
245 }; | 245 }; |
246 | 246 |
247 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 247 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
OLD | NEW |