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 AutofillManager; | |
Ilya Sherman
2013/06/14 02:44:37
nit: This is currently both forward-declared and #
blundell
2013/06/14 09:54:08
Done.
| |
28 class AutofillManagerDelegate; | |
29 | |
30 // Class that drives autofill flow in the browser process based on | |
31 // communication from the renderer and from the external world. There is one | |
32 // instance per WebContents. | |
33 class AutofillDriverImpl : public AutofillDriver, | |
34 public content::WebContentsObserver, | |
35 public base::SupportsUserData::Data { | |
36 public: | |
37 static void CreateForWebContentsAndDelegate( | |
38 content::WebContents* contents, | |
39 autofill::AutofillManagerDelegate* delegate, | |
40 const std::string& app_locale, | |
41 AutofillManager::AutofillDownloadManagerState enable_download_manager, | |
42 bool enable_native_ui); | |
43 static AutofillDriverImpl* FromWebContents(content::WebContents* contents); | |
44 | |
45 // AutofillDriver: | |
46 virtual content::WebContents* GetWebContents() OVERRIDE; | |
47 AutofillManager* autofill_manager() { return autofill_manager_.get(); } | |
Ilya Sherman
2013/06/14 02:44:37
nit: Please leave a blank line above this one, as
blundell
2013/06/14 09:54:08
Done.
| |
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 scoped_ptr<AutofillManager> autofill_manager_; | |
Ilya Sherman
2013/06/14 02:44:37
Any reason not to allocate this as a direct member
blundell
2013/06/14 09:54:08
Nope! Done.
On 2013/06/14 02:44:37, Ilya Sherman
| |
67 }; | |
68 | |
69 } // namespace autofill | |
70 | |
71 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ | |
OLD | NEW |