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