OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EXTERNAL_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ |
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 const std::vector<string16>& autofill_values, | 56 const std::vector<string16>& autofill_values, |
57 const std::vector<string16>& autofill_labels, | 57 const std::vector<string16>& autofill_labels, |
58 const std::vector<string16>& autofill_icons, | 58 const std::vector<string16>& autofill_icons, |
59 const std::vector<int>& autofill_unique_ids); | 59 const std::vector<int>& autofill_unique_ids); |
60 | 60 |
61 // Show password suggestions in the popup. | 61 // Show password suggestions in the popup. |
62 void OnShowPasswordSuggestions(const std::vector<string16>& suggestions, | 62 void OnShowPasswordSuggestions(const std::vector<string16>& suggestions, |
63 const webkit::forms::FormField& field, | 63 const webkit::forms::FormField& field, |
64 const gfx::Rect& bounds); | 64 const gfx::Rect& bounds); |
65 | 65 |
66 // Set the data list value associated with the current field. | |
67 void SetCurrentDataListValues(const std::vector<string16>& values, | |
68 const std::vector<string16>& labels, | |
69 const std::vector<string16>& icons, | |
70 const std::vector<int>& unique_ids); | |
71 | |
66 // Remove the given Autocomplete entry from the DB. | 72 // Remove the given Autocomplete entry from the DB. |
67 virtual void RemoveAutocompleteEntry(const string16& value); | 73 virtual void RemoveAutocompleteEntry(const string16& value); |
68 | 74 |
69 // Remove the given Autofill profile or credit credit. | 75 // Remove the given Autofill profile or credit credit. |
70 virtual void RemoveAutofillProfileOrCreditCard(int unique_id); | 76 virtual void RemoveAutofillProfileOrCreditCard(int unique_id); |
71 | 77 |
72 // Inform the delegate that the text field editing has ended, this is | 78 // Inform the delegate that the text field editing has ended, this is |
73 // used to help record the metrics of when a new popup is shown. | 79 // used to help record the metrics of when a new popup is shown. |
74 void DidEndTextFieldEditing(); | 80 void DidEndTextFieldEditing(); |
75 | 81 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 // Return the profile that this autofill delegate is currently working with. | 134 // Return the profile that this autofill delegate is currently working with. |
129 Profile* profile() { return tab_contents_wrapper_->profile(); } | 135 Profile* profile() { return tab_contents_wrapper_->profile(); } |
130 | 136 |
131 private: | 137 private: |
132 // Fills the form with the Autofill data corresponding to |unique_id|. | 138 // Fills the form with the Autofill data corresponding to |unique_id|. |
133 // If |is_preview| is true then this is just a preview to show the user what | 139 // If |is_preview| is true then this is just a preview to show the user what |
134 // would be selected and if |is_preview| is false then the user has selected | 140 // would be selected and if |is_preview| is false then the user has selected |
135 // this data. | 141 // this data. |
136 void FillAutofillFormData(int unique_id, bool is_preview); | 142 void FillAutofillFormData(int unique_id, bool is_preview); |
137 | 143 |
144 // Handle applying any Autofill warnings to the Autofill popup. | |
145 void ApplyAutofillWarnings(std::vector<string16>* autofill_values, | |
146 std::vector<string16>* autofill_labels, | |
147 std::vector<string16>* autofill_icons, | |
148 std::vector<int>* autofill_unique_ids); | |
149 | |
150 // Handle applying any Autofill option listings to the Autofill popup. | |
Ilya Sherman
2012/06/04 22:05:01
nit: This comment should mention that the method s
csharp
2012/06/06 14:06:52
Done.
| |
151 void ApplyAutofillOptions(std::vector<string16>* autofill_values, | |
152 std::vector<string16>* autofill_labels, | |
153 std::vector<string16>* autofill_icons, | |
154 std::vector<int>* autofill_unique_ids); | |
155 | |
156 // Insert the data list values at the start of the given list, including | |
157 // any required separators. | |
158 void InsertDataListValues(std::vector<string16>* autofill_values, | |
159 std::vector<string16>* autofill_labels, | |
160 std::vector<string16>* autofill_icons, | |
161 std::vector<int>* autofill_unique_ids); | |
Ilya Sherman
2012/06/04 22:05:01
Do these methods all need access to the instantiat
csharp
2012/06/06 14:06:52
They both need access to a few booleans in the cla
Ilya Sherman
2012/06/06 22:25:45
Ok, sounds good. Since they access member boolean
| |
162 | |
138 TabContentsWrapper* tab_contents_wrapper_; // weak; owns me. | 163 TabContentsWrapper* tab_contents_wrapper_; // weak; owns me. |
139 AutofillManager* autofill_manager_; // weak. | 164 AutofillManager* autofill_manager_; // weak. |
140 | 165 |
141 // Password Autofill manager, handles all password-related Autofilling. | 166 // Password Autofill manager, handles all password-related Autofilling. |
142 PasswordAutofillManager password_autofill_manager_; | 167 PasswordAutofillManager password_autofill_manager_; |
143 | 168 |
144 // The ID of the last request sent for form field Autofill. Used to ignore | 169 // The ID of the last request sent for form field Autofill. Used to ignore |
145 // out of date responses. | 170 // out of date responses. |
146 int autofill_query_id_; | 171 int autofill_query_id_; |
147 | 172 |
148 // The current form and field selected by Autofill. | 173 // The current form and field selected by Autofill. |
149 webkit::forms::FormData autofill_query_form_; | 174 webkit::forms::FormData autofill_query_form_; |
150 webkit::forms::FormField autofill_query_field_; | 175 webkit::forms::FormField autofill_query_field_; |
151 | 176 |
152 // Should we display a warning if Autofill is disabled? | 177 // Should we display a warning if Autofill is disabled? |
153 bool display_warning_if_disabled_; | 178 bool display_warning_if_disabled_; |
154 | 179 |
155 // Have we already shown Autofill suggestions for the field the user is | 180 // Have we already shown Autofill suggestions for the field the user is |
156 // currently editing? Used to keep track of state for metrics logging. | 181 // currently editing? Used to keep track of state for metrics logging. |
157 bool has_shown_autofill_popup_for_current_edit_; | 182 bool has_shown_autofill_popup_for_current_edit_; |
158 | 183 |
184 // Used to indicate if a popup is currently being shown or not. | |
185 bool popup_visible_; | |
186 | |
187 // The current data list values. | |
188 std::vector<string16> data_list_values_; | |
189 std::vector<string16> data_list_labels_; | |
190 std::vector<string16> data_list_icons_; | |
191 std::vector<int> data_list_unique_ids_; | |
192 | |
159 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate); | 193 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate); |
160 }; | 194 }; |
161 | 195 |
162 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ | 196 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ |
OLD | NEW |