| 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 <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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); |
| 191 | 195 |
| 192 // Called in a posted task by textFieldDidChange() to work-around a WebKit bug | 196 // Called in a posted task by textFieldDidChange() to work-around a WebKit bug |
| 193 // http://bugs.webkit.org/show_bug.cgi?id=16976 | 197 // http://bugs.webkit.org/show_bug.cgi?id=16976 |
| 194 void TextFieldDidChangeImpl(const blink::WebFormControlElement& element); | 198 void TextFieldDidChangeImpl(const blink::WebFormControlElement& element); |
| 195 | 199 |
| 196 // Shows the autofill suggestions for |element|. This call is asynchronous | 200 // 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 | 201 // and may or may not lead to the showing of a suggestion popup (no popup is |
| 198 // shown if there are no available suggestions). | 202 // shown if there are no available suggestions). |
| 199 void ShowSuggestions(const blink::WebFormControlElement& element, | 203 void ShowSuggestions(const blink::WebFormControlElement& element, |
| 200 const ShowSuggestionsOptions& options); | 204 const ShowSuggestionsOptions& options); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 267 |
| 264 // The element corresponding to the last request sent for form field Autofill. | 268 // The element corresponding to the last request sent for form field Autofill. |
| 265 blink::WebFormControlElement element_; | 269 blink::WebFormControlElement element_; |
| 266 | 270 |
| 267 // The form element currently requesting an interactive autocomplete. | 271 // The form element currently requesting an interactive autocomplete. |
| 268 blink::WebFormElement in_flight_request_form_; | 272 blink::WebFormElement in_flight_request_form_; |
| 269 | 273 |
| 270 // Last form which was interacted with by the user. | 274 // Last form which was interacted with by the user. |
| 271 blink::WebFormElement last_interacted_form_; | 275 blink::WebFormElement last_interacted_form_; |
| 272 | 276 |
| 277 // When dealing with forms that don't use a <form> tag, we keep track of the |
| 278 // elements the user has modified so we can determine when submission occurs. |
| 279 std::set<blink::WebFormControlElement> formless_elements_user_edited_; |
| 280 |
| 273 // Was the query node autofilled prior to previewing the form? | 281 // Was the query node autofilled prior to previewing the form? |
| 274 bool was_query_node_autofilled_; | 282 bool was_query_node_autofilled_; |
| 275 | 283 |
| 276 // Whether or not to ignore text changes. Useful for when we're committing | 284 // 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 | 285 // a composition when we are defocusing the WebView and we don't want to |
| 278 // trigger an autofill popup to show. | 286 // trigger an autofill popup to show. |
| 279 bool ignore_text_changes_; | 287 bool ignore_text_changes_; |
| 280 | 288 |
| 281 // Whether the Autofill popup is possibly visible. This is tracked as a | 289 // Whether the Autofill popup is possibly visible. This is tracked as a |
| 282 // performance improvement, so that the IPC channel isn't flooded with | 290 // performance improvement, so that the IPC channel isn't flooded with |
| (...skipping 11 matching lines...) Expand all Loading... |
| 294 mojom::AutofillDriverPtr mojo_autofill_driver_; | 302 mojom::AutofillDriverPtr mojo_autofill_driver_; |
| 295 | 303 |
| 296 base::WeakPtrFactory<AutofillAgent> weak_ptr_factory_; | 304 base::WeakPtrFactory<AutofillAgent> weak_ptr_factory_; |
| 297 | 305 |
| 298 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); | 306 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); |
| 299 }; | 307 }; |
| 300 | 308 |
| 301 } // namespace autofill | 309 } // namespace autofill |
| 302 | 310 |
| 303 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ | 311 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ |
| OLD | NEW |