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 "components/autofill/core/common/form_data.h" |
| 9 |
8 namespace content { | 10 namespace content { |
9 class WebContents; | 11 class WebContents; |
10 } | 12 } |
11 | 13 |
12 namespace autofill { | 14 namespace autofill { |
13 | 15 |
14 // Interface that provides access to the driver-level context in which Autofill | 16 // Interface that allows Autofill core code to interact with its driver (i.e., |
15 // is operating. A concrete implementation must be provided by the driver. | 17 // obtain information from it and give information to it). A concrete |
| 18 // implementation must be provided by the driver. |
16 class AutofillDriver { | 19 class AutofillDriver { |
17 public: | 20 public: |
18 virtual ~AutofillDriver() {} | 21 virtual ~AutofillDriver() {} |
19 | 22 |
20 // TODO(blundell): Remove this method once shared code no longer needs to | 23 // TODO(blundell): Remove this method once shared code no longer needs to |
21 // know about WebContents. | 24 // know about WebContents. |
22 virtual content::WebContents* GetWebContents() = 0; | 25 virtual content::WebContents* GetWebContents() = 0; |
| 26 |
| 27 // Returns true iff the renderer is available for communication. |
| 28 virtual bool RendererIsAvailable() = 0; |
| 29 |
| 30 // 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 |
| 32 // not currently available. |
| 33 virtual void SendFormDataToRenderer(int query_id, const FormData& data) = 0; |
23 }; | 34 }; |
24 | 35 |
25 } // namespace autofill | 36 } // namespace autofill |
26 | 37 |
27 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DRIVER_H_ | 38 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DRIVER_H_ |
OLD | NEW |