Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: components/autofill/content/renderer/autofill_agent.h

Issue 2065303002: Modifying Autofill Agent to use synthetic form (i.e., formless elements) when no form is present on… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding more tests Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 void OnFillPasswordSuggestion(const base::string16& username, 181 void OnFillPasswordSuggestion(const base::string16& username,
182 const base::string16& password); 182 const base::string16& password);
183 void OnPreviewPasswordSuggestion(const base::string16& username, 183 void OnPreviewPasswordSuggestion(const base::string16& username,
184 const base::string16& password); 184 const base::string16& password);
185 void OnShowInitialPasswordAccountSuggestions( 185 void OnShowInitialPasswordAccountSuggestions(
186 int key, 186 int key,
187 const PasswordFormFillData& form_data); 187 const PasswordFormFillData& form_data);
188 188
189 // Called when a same-page navigation is detected. 189 // Called when a same-page navigation is detected.
190 void OnSamePageNavigationCompleted(); 190 void OnSamePageNavigationCompleted();
191 // Helper method which collects unowned elements (i.e., those not inside a
192 // form tag) and writes them into |output|. Returns true if the process is
193 // successful, and all conditions for firing events are true.
194 bool CollectFormlessElements(FormData* output);
195 FRIEND_TEST_ALL_PREFIXES(FormAutocompleteTest, CollectFormlessElements);
191 196
192 // Called in a posted task by textFieldDidChange() to work-around a WebKit bug 197 // Called in a posted task by textFieldDidChange() to work-around a WebKit bug
193 // http://bugs.webkit.org/show_bug.cgi?id=16976 198 // http://bugs.webkit.org/show_bug.cgi?id=16976
194 void TextFieldDidChangeImpl(const blink::WebFormControlElement& element); 199 void TextFieldDidChangeImpl(const blink::WebFormControlElement& element);
195 200
196 // Shows the autofill suggestions for |element|. This call is asynchronous 201 // Shows the autofill suggestions for |element|. This call is asynchronous
197 // and may or may not lead to the showing of a suggestion popup (no popup is 202 // and may or may not lead to the showing of a suggestion popup (no popup is
198 // shown if there are no available suggestions). 203 // shown if there are no available suggestions).
199 void ShowSuggestions(const blink::WebFormControlElement& element, 204 void ShowSuggestions(const blink::WebFormControlElement& element,
200 const ShowSuggestionsOptions& options); 205 const ShowSuggestionsOptions& options);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 268
264 // The element corresponding to the last request sent for form field Autofill. 269 // The element corresponding to the last request sent for form field Autofill.
265 blink::WebFormControlElement element_; 270 blink::WebFormControlElement element_;
266 271
267 // The form element currently requesting an interactive autocomplete. 272 // The form element currently requesting an interactive autocomplete.
268 blink::WebFormElement in_flight_request_form_; 273 blink::WebFormElement in_flight_request_form_;
269 274
270 // Last form which was interacted with by the user. 275 // Last form which was interacted with by the user.
271 blink::WebFormElement last_interacted_form_; 276 blink::WebFormElement last_interacted_form_;
272 277
278 // When dealing with forms that don't use a <form> tag, we keep track of the
279 // elements the user has modified so we can determine when submission occurs.
280 std::set<blink::WebFormControlElement> formless_elements_user_edited_;
281
273 // Was the query node autofilled prior to previewing the form? 282 // Was the query node autofilled prior to previewing the form?
274 bool was_query_node_autofilled_; 283 bool was_query_node_autofilled_;
275 284
276 // Whether or not to ignore text changes. Useful for when we're committing 285 // Whether or not to ignore text changes. Useful for when we're committing
277 // a composition when we are defocusing the WebView and we don't want to 286 // a composition when we are defocusing the WebView and we don't want to
278 // trigger an autofill popup to show. 287 // trigger an autofill popup to show.
279 bool ignore_text_changes_; 288 bool ignore_text_changes_;
280 289
281 // Whether the Autofill popup is possibly visible. This is tracked as a 290 // Whether the Autofill popup is possibly visible. This is tracked as a
282 // performance improvement, so that the IPC channel isn't flooded with 291 // performance improvement, so that the IPC channel isn't flooded with
(...skipping 11 matching lines...) Expand all
294 mojom::AutofillDriverPtr mojo_autofill_driver_; 303 mojom::AutofillDriverPtr mojo_autofill_driver_;
295 304
296 base::WeakPtrFactory<AutofillAgent> weak_ptr_factory_; 305 base::WeakPtrFactory<AutofillAgent> weak_ptr_factory_;
297 306
298 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); 307 DISALLOW_COPY_AND_ASSIGN(AutofillAgent);
299 }; 308 };
300 309
301 } // namespace autofill 310 } // namespace autofill
302 311
303 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ 312 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_
OLDNEW
« no previous file with comments | « chrome/renderer/autofill/form_autocomplete_browsertest.cc ('k') | components/autofill/content/renderer/autofill_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698