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