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