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" |
11 #include "base/supports_user_data.h" | 11 #include "base/supports_user_data.h" |
12 #include "components/autofill/content/browser/request_autocomplete_manager.h" | 12 #include "components/autofill/content/browser/request_autocomplete_manager.h" |
13 #include "components/autofill/core/browser/autofill_driver.h" | 13 #include "components/autofill/core/browser/autofill_driver.h" |
14 #include "components/autofill/core/browser/autofill_external_delegate.h" | 14 #include "components/autofill/core/browser/autofill_external_delegate.h" |
15 #include "components/autofill/core/browser/autofill_manager.h" | 15 #include "components/autofill/core/browser/autofill_manager.h" |
16 #include "content/public/browser/web_contents_observer.h" | 16 #include "content/public/browser/web_contents_observer.h" |
17 | 17 |
| 18 class PasswordManagerClient; |
| 19 |
18 namespace content { | 20 namespace content { |
19 class WebContents; | 21 class WebContents; |
20 } | 22 } |
21 | 23 |
22 namespace IPC { | 24 namespace IPC { |
23 class Message; | 25 class Message; |
24 } | 26 } |
25 | 27 |
26 namespace autofill { | 28 namespace autofill { |
27 | 29 |
28 class AutofillContext; | 30 class AutofillContext; |
29 class AutofillManagerDelegate; | 31 class AutofillManagerDelegate; |
30 | 32 |
31 // Class that drives autofill flow in the browser process based on | 33 // Class that drives autofill flow in the browser process based on |
32 // communication from the renderer and from the external world. There is one | 34 // communication from the renderer and from the external world. There is one |
33 // instance per WebContents. | 35 // instance per WebContents. |
34 class AutofillDriverImpl : public AutofillDriver, | 36 class AutofillDriverImpl : public AutofillDriver, |
35 public content::WebContentsObserver, | 37 public content::WebContentsObserver, |
36 public base::SupportsUserData::Data { | 38 public base::SupportsUserData::Data { |
37 public: | 39 public: |
38 static void CreateForWebContentsAndDelegate( | 40 static void CreateForWebContentsAndDelegate( |
39 content::WebContents* contents, | 41 content::WebContents* contents, |
40 autofill::AutofillManagerDelegate* delegate, | 42 autofill::AutofillManagerDelegate* delegate, |
| 43 PasswordManagerClient* password_manager_client, |
41 const std::string& app_locale, | 44 const std::string& app_locale, |
42 AutofillManager::AutofillDownloadManagerState enable_download_manager); | 45 AutofillManager::AutofillDownloadManagerState enable_download_manager); |
43 static AutofillDriverImpl* FromWebContents(content::WebContents* contents); | 46 static AutofillDriverImpl* FromWebContents(content::WebContents* contents); |
44 | 47 |
45 // AutofillDriver: | 48 // AutofillDriver: |
46 virtual bool IsOffTheRecord() const OVERRIDE; | 49 virtual bool IsOffTheRecord() const OVERRIDE; |
47 virtual net::URLRequestContextGetter* GetURLRequestContext() OVERRIDE; | 50 virtual net::URLRequestContextGetter* GetURLRequestContext() OVERRIDE; |
48 virtual base::SequencedWorkerPool* GetBlockingPool() OVERRIDE; | 51 virtual base::SequencedWorkerPool* GetBlockingPool() OVERRIDE; |
49 virtual bool RendererIsAvailable() OVERRIDE; | 52 virtual bool RendererIsAvailable() OVERRIDE; |
50 virtual void SetRendererActionOnFormDataReception( | 53 virtual void SetRendererActionOnFormDataReception( |
51 RendererFormDataAction action) OVERRIDE; | 54 RendererFormDataAction action) OVERRIDE; |
52 virtual void SendFormDataToRenderer(int query_id, | 55 virtual void SendFormDataToRenderer(int query_id, |
53 const FormData& data) OVERRIDE; | 56 const FormData& data) OVERRIDE; |
54 virtual void SendAutofillTypePredictionsToRenderer( | 57 virtual void SendAutofillTypePredictionsToRenderer( |
55 const std::vector<FormStructure*>& forms) OVERRIDE; | 58 const std::vector<FormStructure*>& forms) OVERRIDE; |
56 virtual void RendererShouldAcceptDataListSuggestion( | 59 virtual void RendererShouldAcceptDataListSuggestion( |
57 const base::string16& value) OVERRIDE; | 60 const base::string16& value) OVERRIDE; |
58 virtual void RendererShouldAcceptPasswordAutofillSuggestion( | 61 virtual void RendererShouldAcceptPasswordAutofillSuggestion( |
59 const base::string16& username) OVERRIDE; | 62 const base::string16& username, |
| 63 const base::string16& password) OVERRIDE; |
60 virtual void RendererShouldClearFilledForm() OVERRIDE; | 64 virtual void RendererShouldClearFilledForm() OVERRIDE; |
61 virtual void RendererShouldClearPreviewedForm() OVERRIDE; | 65 virtual void RendererShouldClearPreviewedForm() OVERRIDE; |
62 virtual void RendererShouldSetNodeText(const base::string16& value) OVERRIDE; | 66 virtual void RendererShouldSetNodeText(const base::string16& value) OVERRIDE; |
63 | 67 |
64 // Returns the WebContents with which this instance is associated. | 68 // Returns the WebContents with which this instance is associated. |
65 content::WebContents* GetWebContents(); | 69 content::WebContents* GetWebContents(); |
66 | 70 |
67 AutofillExternalDelegate* autofill_external_delegate() { | 71 AutofillExternalDelegate* autofill_external_delegate() { |
68 return &autofill_external_delegate_; | 72 return &autofill_external_delegate_; |
69 } | 73 } |
70 | 74 |
71 AutofillManager* autofill_manager() { return autofill_manager_.get(); } | 75 AutofillManager* autofill_manager() { return autofill_manager_.get(); } |
72 | 76 |
73 protected: | 77 protected: |
74 AutofillDriverImpl( | 78 AutofillDriverImpl( |
75 content::WebContents* web_contents, | 79 content::WebContents* web_contents, |
76 autofill::AutofillManagerDelegate* delegate, | 80 autofill::AutofillManagerDelegate* delegate, |
| 81 PasswordManagerClient* password_manager_client, |
77 const std::string& app_locale, | 82 const std::string& app_locale, |
78 AutofillManager::AutofillDownloadManagerState enable_download_manager); | 83 AutofillManager::AutofillDownloadManagerState enable_download_manager); |
79 virtual ~AutofillDriverImpl(); | 84 virtual ~AutofillDriverImpl(); |
80 | 85 |
81 // content::WebContentsObserver: | 86 // content::WebContentsObserver: |
82 virtual void DidNavigateMainFrame( | 87 virtual void DidNavigateMainFrame( |
83 const content::LoadCommittedDetails& details, | 88 const content::LoadCommittedDetails& details, |
84 const content::FrameNavigateParams& params) OVERRIDE; | 89 const content::FrameNavigateParams& params) OVERRIDE; |
85 virtual void NavigationEntryCommitted( | 90 virtual void NavigationEntryCommitted( |
86 const content::LoadCommittedDetails& load_details) OVERRIDE; | 91 const content::LoadCommittedDetails& load_details) OVERRIDE; |
(...skipping 13 matching lines...) Expand all Loading... |
100 // case where the Autofill native UI is enabled. | 105 // case where the Autofill native UI is enabled. |
101 AutofillExternalDelegate autofill_external_delegate_; | 106 AutofillExternalDelegate autofill_external_delegate_; |
102 | 107 |
103 // Driver for the interactive autocomplete dialog. | 108 // Driver for the interactive autocomplete dialog. |
104 RequestAutocompleteManager request_autocomplete_manager_; | 109 RequestAutocompleteManager request_autocomplete_manager_; |
105 }; | 110 }; |
106 | 111 |
107 } // namespace autofill | 112 } // namespace autofill |
108 | 113 |
109 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ | 114 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ |
OLD | NEW |