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_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ |
6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // communication from the renderer and from the external world. There is one | 31 // communication from the renderer and from the external world. There is one |
32 // instance per WebContents. | 32 // instance per WebContents. |
33 class AutofillDriverImpl : public AutofillDriver, | 33 class AutofillDriverImpl : public AutofillDriver, |
34 public content::WebContentsObserver, | 34 public content::WebContentsObserver, |
35 public base::SupportsUserData::Data { | 35 public base::SupportsUserData::Data { |
36 public: | 36 public: |
37 static void CreateForWebContentsAndDelegate( | 37 static void CreateForWebContentsAndDelegate( |
38 content::WebContents* contents, | 38 content::WebContents* contents, |
39 autofill::AutofillManagerDelegate* delegate, | 39 autofill::AutofillManagerDelegate* delegate, |
40 const std::string& app_locale, | 40 const std::string& app_locale, |
41 AutofillManager::AutofillDownloadManagerState enable_download_manager, | 41 AutofillManager::AutofillDownloadManagerState enable_download_manager); |
42 bool enable_native_ui); | |
43 static AutofillDriverImpl* FromWebContents(content::WebContents* contents); | 42 static AutofillDriverImpl* FromWebContents(content::WebContents* contents); |
44 | 43 |
45 // AutofillDriver: | 44 // AutofillDriver: |
46 virtual content::WebContents* GetWebContents() OVERRIDE; | 45 virtual content::WebContents* GetWebContents() OVERRIDE; |
47 | 46 |
48 AutofillExternalDelegate* autofill_external_delegate() { | 47 AutofillExternalDelegate* autofill_external_delegate() { |
49 return autofill_external_delegate_.get(); | 48 return autofill_external_delegate_.get(); |
50 } | 49 } |
51 | 50 |
52 // Sets the external delegate to |delegate| both within this class and in the | 51 // Sets the external delegate to |delegate| both within this class and in the |
53 // shared Autofill code. Takes ownership of |delegate|. | 52 // shared Autofill code. Takes ownership of |delegate|. |
54 void SetAutofillExternalDelegate( | 53 void SetAutofillExternalDelegate( |
55 scoped_ptr<AutofillExternalDelegate> delegate); | 54 scoped_ptr<AutofillExternalDelegate> delegate); |
56 | 55 |
57 AutofillManager* autofill_manager() { return &autofill_manager_; } | 56 AutofillManager* autofill_manager() { return &autofill_manager_; } |
58 | 57 |
59 private: | 58 private: |
60 AutofillDriverImpl( | 59 AutofillDriverImpl( |
61 content::WebContents* web_contents, | 60 content::WebContents* web_contents, |
62 autofill::AutofillManagerDelegate* delegate, | 61 autofill::AutofillManagerDelegate* delegate, |
63 const std::string& app_locale, | 62 const std::string& app_locale, |
64 AutofillManager::AutofillDownloadManagerState enable_download_manager, | 63 AutofillManager::AutofillDownloadManagerState enable_download_manager); |
65 bool enable_native_ui); | |
66 virtual ~AutofillDriverImpl(); | 64 virtual ~AutofillDriverImpl(); |
67 | 65 |
68 // content::WebContentsObserver: | 66 // content::WebContentsObserver: |
69 virtual void DidNavigateMainFrame( | 67 virtual void DidNavigateMainFrame( |
70 const content::LoadCommittedDetails& details, | 68 const content::LoadCommittedDetails& details, |
71 const content::FrameNavigateParams& params) OVERRIDE; | 69 const content::FrameNavigateParams& params) OVERRIDE; |
72 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 70 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
73 | 71 |
74 // AutofillExternalDelegate instance that this object instantiates in the | 72 // AutofillExternalDelegate instance that this object instantiates in the |
75 // case where the autofill native UI is enabled. | 73 // case where the autofill native UI is enabled. |
76 scoped_ptr<AutofillExternalDelegate> autofill_external_delegate_; | 74 scoped_ptr<AutofillExternalDelegate> autofill_external_delegate_; |
77 | 75 |
78 // AutofillManager instance via which this object drives the shared Autofill | 76 // AutofillManager instance via which this object drives the shared Autofill |
79 // code. | 77 // code. |
80 AutofillManager autofill_manager_; | 78 AutofillManager autofill_manager_; |
81 }; | 79 }; |
82 | 80 |
83 } // namespace autofill | 81 } // namespace autofill |
84 | 82 |
85 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ | 83 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ |
OLD | NEW |