| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <vector> | 9 #include <vector> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // corresponding credit card: 'Home; *1258' - Home is the Profile label and | 102 // corresponding credit card: 'Home; *1258' - Home is the Profile label and |
| 103 // 1258 is the last four digits of the credit card. If |include_cc_labels| is | 103 // 1258 is the last four digits of the credit card. If |include_cc_labels| is |
| 104 // true, check for billing fields and append CC digits to the labels; | 104 // true, check for billing fields and append CC digits to the labels; |
| 105 // otherwise, regular profiles are returned for billing address fields. | 105 // otherwise, regular profiles are returned for billing address fields. |
| 106 void GetProfileSuggestions(FormStructure* form, | 106 void GetProfileSuggestions(FormStructure* form, |
| 107 const webkit_glue::FormField& field, | 107 const webkit_glue::FormField& field, |
| 108 AutoFillType type, | 108 AutoFillType type, |
| 109 bool include_cc_labels, | 109 bool include_cc_labels, |
| 110 std::vector<string16>* values, | 110 std::vector<string16>* values, |
| 111 std::vector<string16>* labels, | 111 std::vector<string16>* labels, |
| 112 std::vector<string16>* icons, |
| 112 std::vector<int>* unique_ids); | 113 std::vector<int>* unique_ids); |
| 113 | 114 |
| 114 // Same as GetProfileSuggestions, but the list of stored profiles is limited | 115 // Same as GetProfileSuggestions, but the list of stored profiles is limited |
| 115 // to the linked billing addresses from the list of credit cards. | 116 // to the linked billing addresses from the list of credit cards. |
| 116 void GetBillingProfileSuggestions(FormStructure* form, | 117 void GetBillingProfileSuggestions(FormStructure* form, |
| 117 const webkit_glue::FormField& field, | 118 const webkit_glue::FormField& field, |
| 118 AutoFillType type, | 119 AutoFillType type, |
| 119 std::vector<string16>* values, | 120 std::vector<string16>* values, |
| 120 std::vector<string16>* labels, | 121 std::vector<string16>* labels, |
| 122 std::vector<string16>* icons, |
| 121 std::vector<int>* unique_ids); | 123 std::vector<int>* unique_ids); |
| 122 | 124 |
| 123 // Returns a list of values from the stored credit cards that match |type| and | 125 // Returns a list of values from the stored credit cards that match |type| and |
| 124 // the value of |field| and returns the labels of the matching credit cards. | 126 // the value of |field| and returns the labels of the matching credit cards. |
| 125 void GetCreditCardSuggestions(FormStructure* form, | 127 void GetCreditCardSuggestions(FormStructure* form, |
| 126 const webkit_glue::FormField& field, | 128 const webkit_glue::FormField& field, |
| 127 AutoFillType type, | 129 AutoFillType type, |
| 128 std::vector<string16>* values, | 130 std::vector<string16>* values, |
| 129 std::vector<string16>* labels, | 131 std::vector<string16>* labels, |
| 132 std::vector<string16>* icons, |
| 130 std::vector<int>* unique_ids); | 133 std::vector<int>* unique_ids); |
| 131 | 134 |
| 132 // Set |field| argument's value based on |type| and contents of the | 135 // Set |field| argument's value based on |type| and contents of the |
| 133 // |credit_card|. The |type| field is expected to have main group type of | 136 // |credit_card|. The |type| field is expected to have main group type of |
| 134 // ADDRESS_BILLING. The address information is retrieved from the billing | 137 // ADDRESS_BILLING. The address information is retrieved from the billing |
| 135 // profile associated with the |credit_card|, if there is one set. | 138 // profile associated with the |credit_card|, if there is one set. |
| 136 void FillBillingFormField(const CreditCard* credit_card, | 139 void FillBillingFormField(const CreditCard* credit_card, |
| 137 AutoFillType type, | 140 AutoFillType type, |
| 138 webkit_glue::FormField* field); | 141 webkit_glue::FormField* field); |
| 139 | 142 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 196 |
| 194 friend class AutoFillManagerTest; | 197 friend class AutoFillManagerTest; |
| 195 FRIEND_TEST_ALL_PREFIXES(AutoFillManagerTest, FillCreditCardForm); | 198 FRIEND_TEST_ALL_PREFIXES(AutoFillManagerTest, FillCreditCardForm); |
| 196 FRIEND_TEST_ALL_PREFIXES(AutoFillManagerTest, FillNonBillingFormSemicolon); | 199 FRIEND_TEST_ALL_PREFIXES(AutoFillManagerTest, FillNonBillingFormSemicolon); |
| 197 FRIEND_TEST_ALL_PREFIXES(AutoFillManagerTest, FillBillFormSemicolon); | 200 FRIEND_TEST_ALL_PREFIXES(AutoFillManagerTest, FillBillFormSemicolon); |
| 198 | 201 |
| 199 DISALLOW_COPY_AND_ASSIGN(AutoFillManager); | 202 DISALLOW_COPY_AND_ASSIGN(AutoFillManager); |
| 200 }; | 203 }; |
| 201 | 204 |
| 202 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 205 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
| OLD | NEW |