OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/supports_user_data.h" |
| 11 #include "components/autofill/browser/autofill_driver.h" |
| 12 #include "components/autofill/browser/autofill_manager.h" |
| 13 #include "content/public/browser/web_contents_observer.h" |
| 14 |
| 15 namespace content { |
| 16 class WebContents; |
| 17 } |
| 18 |
| 19 namespace IPC { |
| 20 class Message; |
| 21 } |
| 22 |
| 23 namespace autofill { |
| 24 |
| 25 class AutofillContext; |
| 26 class AutofillExternalDelegate; |
| 27 class AutofillManagerDelegate; |
| 28 |
| 29 // Class that drives autofill flow in the browser process based on |
| 30 // communication from the renderer and from the external world. There is one |
| 31 // instance per WebContents. |
| 32 class AutofillDriverImpl : public AutofillDriver, |
| 33 public content::WebContentsObserver, |
| 34 public base::SupportsUserData::Data { |
| 35 public: |
| 36 static void CreateForWebContentsAndDelegate( |
| 37 content::WebContents* contents, |
| 38 autofill::AutofillManagerDelegate* delegate, |
| 39 const std::string& app_locale, |
| 40 AutofillManager::AutofillDownloadManagerState enable_download_manager, |
| 41 bool enable_native_ui); |
| 42 static AutofillDriverImpl* FromWebContents(content::WebContents* contents); |
| 43 |
| 44 // AutofillDriver: |
| 45 virtual content::WebContents* GetWebContents() OVERRIDE; |
| 46 |
| 47 AutofillManager* autofill_manager() { return &autofill_manager_; } |
| 48 |
| 49 private: |
| 50 AutofillDriverImpl( |
| 51 content::WebContents* web_contents, |
| 52 autofill::AutofillManagerDelegate* delegate, |
| 53 const std::string& app_locale, |
| 54 AutofillManager::AutofillDownloadManagerState enable_download_manager, |
| 55 bool enable_native_ui); |
| 56 virtual ~AutofillDriverImpl(); |
| 57 |
| 58 // content::WebContentsObserver: |
| 59 virtual void DidNavigateMainFrame( |
| 60 const content::LoadCommittedDetails& details, |
| 61 const content::FrameNavigateParams& params) OVERRIDE; |
| 62 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 63 |
| 64 // AutofillManager instance via which this object drives the shared Autofill |
| 65 // code. |
| 66 AutofillManager autofill_manager_; |
| 67 }; |
| 68 |
| 69 } // namespace autofill |
| 70 |
| 71 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ |
OLD | NEW |