| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 void OnFormDataFilled(int query_id, const FormData& form); | 99 void OnFormDataFilled(int query_id, const FormData& form); |
| 100 void OnFieldTypePredictionsAvailable( | 100 void OnFieldTypePredictionsAvailable( |
| 101 const std::vector<FormDataPredictions>& forms); | 101 const std::vector<FormDataPredictions>& forms); |
| 102 | 102 |
| 103 // For external Autofill selection. | 103 // For external Autofill selection. |
| 104 void OnSetAutofillActionFill(); | 104 void OnSetAutofillActionFill(); |
| 105 void OnClearForm(); | 105 void OnClearForm(); |
| 106 void OnSetAutofillActionPreview(); | 106 void OnSetAutofillActionPreview(); |
| 107 void OnClearPreviewedForm(); | 107 void OnClearPreviewedForm(); |
| 108 void OnSetNodeText(const base::string16& value); | 108 void OnFillFieldWithValue(const base::string16& value); |
| 109 void OnPreviewFieldWithValue(const base::string16& value); |
| 109 void OnAcceptDataListSuggestion(const base::string16& value); | 110 void OnAcceptDataListSuggestion(const base::string16& value); |
| 110 void OnAcceptPasswordAutofillSuggestion(const base::string16& username); | 111 void OnAcceptPasswordAutofillSuggestion(const base::string16& username); |
| 111 | 112 |
| 112 // Called when interactive autocomplete finishes. | 113 // Called when interactive autocomplete finishes. |
| 113 void OnRequestAutocompleteResult( | 114 void OnRequestAutocompleteResult( |
| 114 blink::WebFormElement::AutocompleteResult result, | 115 blink::WebFormElement::AutocompleteResult result, |
| 115 const FormData& form_data); | 116 const FormData& form_data); |
| 116 | 117 |
| 117 // Called when an autocomplete request succeeds or fails with the |result|. | 118 // Called when an autocomplete request succeeds or fails with the |result|. |
| 118 void FinishAutocompleteRequest( | 119 void FinishAutocompleteRequest( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 AutofillAction action); | 165 AutofillAction action); |
| 165 | 166 |
| 166 // Fills |form| and |field| with the FormData and FormField corresponding to | 167 // Fills |form| and |field| with the FormData and FormField corresponding to |
| 167 // |node|. Returns true if the data was found; and false otherwise. | 168 // |node|. Returns true if the data was found; and false otherwise. |
| 168 bool FindFormAndFieldForNode( | 169 bool FindFormAndFieldForNode( |
| 169 const blink::WebNode& node, | 170 const blink::WebNode& node, |
| 170 FormData* form, | 171 FormData* form, |
| 171 FormFieldData* field) WARN_UNUSED_RESULT; | 172 FormFieldData* field) WARN_UNUSED_RESULT; |
| 172 | 173 |
| 173 // Set |node| to display the given |value|. | 174 // Set |node| to display the given |value|. |
| 174 void SetNodeText(const base::string16& value, blink::WebInputElement* node); | 175 void FillFieldWithValue(const base::string16& value, |
| 176 blink::WebInputElement* node); |
| 177 |
| 178 // Set |node| to display the given |value| as a preview. The preview is |
| 179 // visible on screen to the user, but not visible to the page via the DOM or |
| 180 // JavaScript. |
| 181 void PreviewFieldWithValue(const base::string16& value, |
| 182 blink::WebInputElement* node); |
| 175 | 183 |
| 176 // Hides any currently showing Autofill popup. | 184 // Hides any currently showing Autofill popup. |
| 177 void HidePopup(); | 185 void HidePopup(); |
| 178 | 186 |
| 179 FormCache form_cache_; | 187 FormCache form_cache_; |
| 180 | 188 |
| 181 PasswordAutofillAgent* password_autofill_agent_; // Weak reference. | 189 PasswordAutofillAgent* password_autofill_agent_; // Weak reference. |
| 182 PasswordGenerationAgent* password_generation_agent_; // Weak reference. | 190 PasswordGenerationAgent* password_generation_agent_; // Weak reference. |
| 183 | 191 |
| 184 // The ID of the last request sent for form field Autofill. Used to ignore | 192 // The ID of the last request sent for form field Autofill. Used to ignore |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 FRIEND_TEST_ALL_PREFIXES( | 251 FRIEND_TEST_ALL_PREFIXES( |
| 244 PasswordAutofillAgentTest, | 252 PasswordAutofillAgentTest, |
| 245 PasswordAutofillTriggersOnChangeEventsWaitForUsername); | 253 PasswordAutofillTriggersOnChangeEventsWaitForUsername); |
| 246 | 254 |
| 247 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); | 255 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); |
| 248 }; | 256 }; |
| 249 | 257 |
| 250 } // namespace autofill | 258 } // namespace autofill |
| 251 | 259 |
| 252 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ | 260 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ |
| OLD | NEW |