| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "chrome/browser/renderer_host/render_view_host_delegate.h" | 9 #include "chrome/browser/renderer_host/render_view_host_delegate.h" |
| 10 | 10 |
| 11 namespace webkit_glue { | 11 namespace webkit_glue { |
| 12 class FormFieldValues; | 12 class FormFieldValues; |
| 13 } | 13 } |
| 14 | 14 |
| 15 class AutoFillInfoBarDelegate; | 15 class AutoFillInfoBarDelegate; |
| 16 class FormStructure; |
| 16 class TabContents; | 17 class TabContents; |
| 17 | 18 |
| 18 // Manages saving and restoring the user's personal information entered into web | 19 // Manages saving and restoring the user's personal information entered into web |
| 19 // forms. | 20 // forms. |
| 20 class AutoFillManager : public RenderViewHostDelegate::AutoFill { | 21 class AutoFillManager : public RenderViewHostDelegate::AutoFill { |
| 21 public: | 22 public: |
| 22 explicit AutoFillManager(TabContents* tab_contents); | 23 explicit AutoFillManager(TabContents* tab_contents); |
| 23 virtual ~AutoFillManager(); | 24 virtual ~AutoFillManager(); |
| 24 | 25 |
| 25 // RenderViewHostDelegate::AutoFill implementation. | 26 // RenderViewHostDelegate::AutoFill implementation. |
| 26 virtual void FormFieldValuesSubmitted( | 27 virtual void FormFieldValuesSubmitted( |
| 27 const webkit_glue::FormFieldValues& form); | 28 const webkit_glue::FormFieldValues& form); |
| 28 | 29 |
| 29 // Saves the form data to the web database. | 30 // Saves the form data to the web database. |
| 30 void SaveFormData(); | 31 void SaveFormData(); |
| 31 | 32 |
| 33 // Uploads the form data to the autofill server. |
| 34 void UploadFormData(); |
| 35 |
| 32 // Resets the stored form data. | 36 // Resets the stored form data. |
| 33 void Reset(); | 37 void Reset(); |
| 34 | 38 |
| 35 private: | 39 private: |
| 36 // The TabContents hosting this AutoFillManager. | 40 // The TabContents hosting this AutoFillManager. |
| 37 TabContents* tab_contents_; | 41 TabContents* tab_contents_; |
| 38 | 42 |
| 39 // Our copy of the form data. | 43 // Our copy of the form data. |
| 40 scoped_ptr<webkit_glue::FormFieldValues> form_data_; | 44 scoped_ptr<FormStructure> form_structure_; |
| 41 | 45 |
| 42 // The infobar asking for permission to store form information. | 46 // The infobar asking for permission to store form information. |
| 43 scoped_ptr<AutoFillInfoBarDelegate> infobar_; | 47 scoped_ptr<AutoFillInfoBarDelegate> infobar_; |
| 44 | 48 |
| 45 DISALLOW_COPY_AND_ASSIGN(AutoFillManager); | 49 DISALLOW_COPY_AND_ASSIGN(AutoFillManager); |
| 46 }; | 50 }; |
| 47 | 51 |
| 48 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 52 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
| OLD | NEW |