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> |
| 9 |
8 #include "components/autofill/core/common/form_data.h" | 10 #include "components/autofill/core/common/form_data.h" |
9 | 11 |
10 namespace content { | 12 namespace content { |
11 class WebContents; | 13 class WebContents; |
12 } | 14 } |
13 | 15 |
14 namespace autofill { | 16 namespace autofill { |
15 | 17 |
| 18 class FormStructure; |
| 19 |
16 // Interface that allows Autofill core code to interact with its driver (i.e., | 20 // Interface that allows Autofill core code to interact with its driver (i.e., |
17 // obtain information from it and give information to it). A concrete | 21 // obtain information from it and give information to it). A concrete |
18 // implementation must be provided by the driver. | 22 // implementation must be provided by the driver. |
19 class AutofillDriver { | 23 class AutofillDriver { |
20 public: | 24 public: |
21 virtual ~AutofillDriver() {} | 25 virtual ~AutofillDriver() {} |
22 | 26 |
23 // TODO(blundell): Remove this method once shared code no longer needs to | 27 // TODO(blundell): Remove this method once shared code no longer needs to |
24 // know about WebContents. | 28 // know about WebContents. |
25 virtual content::WebContents* GetWebContents() = 0; | 29 virtual content::WebContents* GetWebContents() = 0; |
26 | 30 |
27 // Returns true iff the renderer is available for communication. | 31 // Returns true iff the renderer is available for communication. |
28 virtual bool RendererIsAvailable() = 0; | 32 virtual bool RendererIsAvailable() = 0; |
29 | 33 |
30 // Forwards |data| to the renderer. |query_id| is the id of the renderer's | 34 // Forwards |data| to the renderer. |query_id| is the id of the renderer's |
31 // original request for the data. This method is a no-op if the renderer is | 35 // original request for the data. This method is a no-op if the renderer is |
32 // not currently available. | 36 // not currently available. |
33 virtual void SendFormDataToRenderer(int query_id, const FormData& data) = 0; | 37 virtual void SendFormDataToRenderer(int query_id, const FormData& data) = 0; |
| 38 |
| 39 // Sends the field type predictions specified in |forms| to the renderer. This |
| 40 // method is a no-op if the renderer is not available or the appropriate |
| 41 // command-line flag is not set. |
| 42 virtual void SendAutofillTypePredictionsToRenderer( |
| 43 const std::vector<FormStructure*>& forms) = 0; |
34 }; | 44 }; |
35 | 45 |
36 } // namespace autofill | 46 } // namespace autofill |
37 | 47 |
38 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DRIVER_H_ | 48 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DRIVER_H_ |
OLD | NEW |