| 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_CORE_BROWSER_AUTOFILL_DRIVER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DRIVER_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DRIVER_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DRIVER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "components/autofill/core/common/form_data.h" | 10 #include "components/autofill/core/common/form_data.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class SequencedWorkerPool; | 13 class SequencedWorkerPool; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 class WebContents; | 17 class WebContents; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace net { | 20 namespace net { |
| 21 class URLRequestContextGetter; | 21 class URLRequestContextGetter; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace autofill { | 24 namespace autofill { |
| 25 | 25 |
| 26 class FormStructure; | 26 class FormStructure; |
| 27 class PasswordForm; |
| 27 | 28 |
| 28 // Interface that allows Autofill core code to interact with its driver (i.e., | 29 // Interface that allows Autofill core code to interact with its driver (i.e., |
| 29 // obtain information from it and give information to it). A concrete | 30 // obtain information from it and give information to it). A concrete |
| 30 // implementation must be provided by the driver. | 31 // implementation must be provided by the driver. |
| 31 class AutofillDriver { | 32 class AutofillDriver { |
| 32 public: | 33 public: |
| 33 // The possible actions that the renderer can take on receiving form data. | 34 // The possible actions that the renderer can take on receiving form data. |
| 34 enum RendererFormDataAction { | 35 enum RendererFormDataAction { |
| 35 // The renderer should fill the form data. | 36 // The renderer should fill the form data. |
| 36 FORM_DATA_ACTION_FILL, | 37 FORM_DATA_ACTION_FILL, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 67 // original request for the data. This method is a no-op if the renderer is | 68 // original request for the data. This method is a no-op if the renderer is |
| 68 // not currently available. | 69 // not currently available. |
| 69 virtual void SendFormDataToRenderer(int query_id, const FormData& data) = 0; | 70 virtual void SendFormDataToRenderer(int query_id, const FormData& data) = 0; |
| 70 | 71 |
| 71 // Sends the field type predictions specified in |forms| to the renderer. This | 72 // Sends the field type predictions specified in |forms| to the renderer. This |
| 72 // method is a no-op if the renderer is not available or the appropriate | 73 // method is a no-op if the renderer is not available or the appropriate |
| 73 // command-line flag is not set. | 74 // command-line flag is not set. |
| 74 virtual void SendAutofillTypePredictionsToRenderer( | 75 virtual void SendAutofillTypePredictionsToRenderer( |
| 75 const std::vector<FormStructure*>& forms) = 0; | 76 const std::vector<FormStructure*>& forms) = 0; |
| 76 | 77 |
| 78 // Remove the |password_form| sugesstion |
| 79 virtual void RemovePasswordAutofillSuggestion( |
| 80 const PasswordForm& password_form) = 0; |
| 81 |
| 77 // Tells the renderer to accept data list suggestions for |value|. | 82 // Tells the renderer to accept data list suggestions for |value|. |
| 78 virtual void RendererShouldAcceptDataListSuggestion( | 83 virtual void RendererShouldAcceptDataListSuggestion( |
| 79 const base::string16& value) = 0; | 84 const base::string16& value) = 0; |
| 80 | 85 |
| 81 // Tells the renderer to accept the password autofill suggestion for | 86 // Tells the renderer to accept the password autofill suggestion for |
| 82 // |username|. | 87 // |username|. |
| 83 virtual void RendererShouldAcceptPasswordAutofillSuggestion( | 88 virtual void RendererShouldAcceptPasswordAutofillSuggestion( |
| 84 const base::string16& username) = 0; | 89 const base::string16& username) = 0; |
| 85 | 90 |
| 86 // Tells the renderer to clear the currently filled Autofill results. | 91 // Tells the renderer to clear the currently filled Autofill results. |
| 87 virtual void RendererShouldClearFilledForm() = 0; | 92 virtual void RendererShouldClearFilledForm() = 0; |
| 88 | 93 |
| 89 // Tells the renderer to clear the currently previewed Autofill results. | 94 // Tells the renderer to clear the currently previewed Autofill results. |
| 90 virtual void RendererShouldClearPreviewedForm() = 0; | 95 virtual void RendererShouldClearPreviewedForm() = 0; |
| 91 | 96 |
| 92 // Tells the renderer to set the node text. | 97 // Tells the renderer to set the node text. |
| 93 virtual void RendererShouldSetNodeText(const base::string16& value) = 0; | 98 virtual void RendererShouldSetNodeText(const base::string16& value) = 0; |
| 94 }; | 99 }; |
| 95 | 100 |
| 96 } // namespace autofill | 101 } // namespace autofill |
| 97 | 102 |
| 98 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DRIVER_H_ | 103 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DRIVER_H_ |
| OLD | NEW |