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_CONTENT_RENDERER_AUTOFILL_AGENT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ |
6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 virtual void openTextDataListChooser(const blink::WebInputElement& element); | 90 virtual void openTextDataListChooser(const blink::WebInputElement& element); |
91 | 91 |
92 void OnFieldTypePredictionsAvailable( | 92 void OnFieldTypePredictionsAvailable( |
93 const std::vector<FormDataPredictions>& forms); | 93 const std::vector<FormDataPredictions>& forms); |
94 void OnFillForm(int query_id, const FormData& form); | 94 void OnFillForm(int query_id, const FormData& form); |
95 void OnPreviewForm(int query_id, const FormData& form); | 95 void OnPreviewForm(int query_id, const FormData& form); |
96 | 96 |
97 // For external Autofill selection. | 97 // For external Autofill selection. |
98 void OnClearForm(); | 98 void OnClearForm(); |
99 void OnClearPreviewedForm(); | 99 void OnClearPreviewedForm(); |
100 void OnSetNodeText(const base::string16& value); | 100 void OnFillFieldWithValue(const base::string16& value); |
| 101 void OnPreviewFieldWithValue(const base::string16& value); |
101 void OnAcceptDataListSuggestion(const base::string16& value); | 102 void OnAcceptDataListSuggestion(const base::string16& value); |
102 void OnAcceptPasswordAutofillSuggestion(const base::string16& username); | 103 void OnAcceptPasswordAutofillSuggestion(const base::string16& username); |
103 | 104 |
104 // Called when interactive autocomplete finishes. | 105 // Called when interactive autocomplete finishes. |
105 void OnRequestAutocompleteResult( | 106 void OnRequestAutocompleteResult( |
106 blink::WebFormElement::AutocompleteResult result, | 107 blink::WebFormElement::AutocompleteResult result, |
107 const FormData& form_data); | 108 const FormData& form_data); |
108 | 109 |
109 // Called when an autocomplete request succeeds or fails with the |result|. | 110 // Called when an autocomplete request succeeds or fails with the |result|. |
110 void FinishAutocompleteRequest( | 111 void FinishAutocompleteRequest( |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 void AcceptDataListSuggestion(const base::string16& suggested_value); | 145 void AcceptDataListSuggestion(const base::string16& suggested_value); |
145 | 146 |
146 // Fills |form| and |field| with the FormData and FormField corresponding to | 147 // Fills |form| and |field| with the FormData and FormField corresponding to |
147 // |node|. Returns true if the data was found; and false otherwise. | 148 // |node|. Returns true if the data was found; and false otherwise. |
148 bool FindFormAndFieldForNode( | 149 bool FindFormAndFieldForNode( |
149 const blink::WebNode& node, | 150 const blink::WebNode& node, |
150 FormData* form, | 151 FormData* form, |
151 FormFieldData* field) WARN_UNUSED_RESULT; | 152 FormFieldData* field) WARN_UNUSED_RESULT; |
152 | 153 |
153 // Set |node| to display the given |value|. | 154 // Set |node| to display the given |value|. |
154 void SetNodeText(const base::string16& value, blink::WebInputElement* node); | 155 void FillFieldWithValue(const base::string16& value, |
| 156 blink::WebInputElement* node); |
| 157 |
| 158 // Set |node| to display the given |value| as a preview. The preview is |
| 159 // visible on screen to the user, but not visible to the page via the DOM or |
| 160 // JavaScript. |
| 161 void PreviewFieldWithValue(const base::string16& value, |
| 162 blink::WebInputElement* node); |
155 | 163 |
156 // Hides any currently showing Autofill popup. | 164 // Hides any currently showing Autofill popup. |
157 void HidePopup(); | 165 void HidePopup(); |
158 | 166 |
159 FormCache form_cache_; | 167 FormCache form_cache_; |
160 | 168 |
161 PasswordAutofillAgent* password_autofill_agent_; // Weak reference. | 169 PasswordAutofillAgent* password_autofill_agent_; // Weak reference. |
162 PasswordGenerationAgent* password_generation_agent_; // Weak reference. | 170 PasswordGenerationAgent* password_generation_agent_; // Weak reference. |
163 | 171 |
164 // The ID of the last request sent for form field Autofill. Used to ignore | 172 // The ID of the last request sent for form field Autofill. Used to ignore |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 FRIEND_TEST_ALL_PREFIXES( | 227 FRIEND_TEST_ALL_PREFIXES( |
220 PasswordAutofillAgentTest, | 228 PasswordAutofillAgentTest, |
221 PasswordAutofillTriggersOnChangeEventsWaitForUsername); | 229 PasswordAutofillTriggersOnChangeEventsWaitForUsername); |
222 | 230 |
223 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); | 231 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); |
224 }; | 232 }; |
225 | 233 |
226 } // namespace autofill | 234 } // namespace autofill |
227 | 235 |
228 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ | 236 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ |
OLD | NEW |