| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CONTENT_AUTOFILL_DRIVER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_CONTENT_AUTOFILL_DRIVER_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_CONTENT_AUTOFILL_DRIVER_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_CONTENT_AUTOFILL_DRIVER_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 24 matching lines...) Expand all Loading... |
| 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 AutofillClient* client, | 39 AutofillClient* client, |
| 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 static ContentAutofillDriver* FromWebContents(content::WebContents* contents); | 42 static ContentAutofillDriver* FromWebContents(content::WebContents* contents); |
| 43 | 43 |
| 44 // AutofillDriver: | 44 // AutofillDriver: |
| 45 virtual bool IsOffTheRecord() const override; | 45 bool IsOffTheRecord() const override; |
| 46 virtual net::URLRequestContextGetter* GetURLRequestContext() override; | 46 net::URLRequestContextGetter* GetURLRequestContext() override; |
| 47 virtual base::SequencedWorkerPool* GetBlockingPool() override; | 47 base::SequencedWorkerPool* GetBlockingPool() override; |
| 48 virtual bool RendererIsAvailable() override; | 48 bool RendererIsAvailable() override; |
| 49 virtual void SendFormDataToRenderer(int query_id, | 49 void SendFormDataToRenderer(int query_id, |
| 50 RendererFormDataAction action, | 50 RendererFormDataAction action, |
| 51 const FormData& data) override; | 51 const FormData& data) override; |
| 52 virtual void PingRenderer() override; | 52 void PingRenderer() override; |
| 53 virtual void SendAutofillTypePredictionsToRenderer( | 53 void SendAutofillTypePredictionsToRenderer( |
| 54 const std::vector<FormStructure*>& forms) override; | 54 const std::vector<FormStructure*>& forms) override; |
| 55 virtual void RendererShouldAcceptDataListSuggestion( | 55 void RendererShouldAcceptDataListSuggestion( |
| 56 const base::string16& value) override; | 56 const base::string16& value) override; |
| 57 virtual void RendererShouldClearFilledForm() override; | 57 void RendererShouldClearFilledForm() override; |
| 58 virtual void RendererShouldClearPreviewedForm() override; | 58 void RendererShouldClearPreviewedForm() override; |
| 59 virtual void RendererShouldFillFieldWithValue( | 59 void RendererShouldFillFieldWithValue(const base::string16& value) override; |
| 60 const base::string16& value) override; | 60 void RendererShouldPreviewFieldWithValue( |
| 61 virtual void RendererShouldPreviewFieldWithValue( | |
| 62 const base::string16& value) override; | 61 const base::string16& value) override; |
| 63 | 62 |
| 64 AutofillExternalDelegate* autofill_external_delegate() { | 63 AutofillExternalDelegate* autofill_external_delegate() { |
| 65 return &autofill_external_delegate_; | 64 return &autofill_external_delegate_; |
| 66 } | 65 } |
| 67 | 66 |
| 68 AutofillManager* autofill_manager() { return autofill_manager_.get(); } | 67 AutofillManager* autofill_manager() { return autofill_manager_.get(); } |
| 69 | 68 |
| 70 protected: | 69 protected: |
| 71 ContentAutofillDriver( | 70 ContentAutofillDriver( |
| 72 content::WebContents* web_contents, | 71 content::WebContents* web_contents, |
| 73 AutofillClient* client, | 72 AutofillClient* client, |
| 74 const std::string& app_locale, | 73 const std::string& app_locale, |
| 75 AutofillManager::AutofillDownloadManagerState enable_download_manager); | 74 AutofillManager::AutofillDownloadManagerState enable_download_manager); |
| 76 virtual ~ContentAutofillDriver(); | 75 ~ContentAutofillDriver() override; |
| 77 | 76 |
| 78 // content::WebContentsObserver: | 77 // content::WebContentsObserver: |
| 79 virtual void DidNavigateMainFrame( | 78 void DidNavigateMainFrame( |
| 80 const content::LoadCommittedDetails& details, | 79 const content::LoadCommittedDetails& details, |
| 81 const content::FrameNavigateParams& params) override; | 80 const content::FrameNavigateParams& params) override; |
| 82 virtual void NavigationEntryCommitted( | 81 void NavigationEntryCommitted( |
| 83 const content::LoadCommittedDetails& load_details) override; | 82 const content::LoadCommittedDetails& load_details) override; |
| 84 virtual void WasHidden() override; | 83 void WasHidden() override; |
| 85 virtual bool OnMessageReceived(const IPC::Message& message) override; | 84 bool OnMessageReceived(const IPC::Message& message) override; |
| 86 | 85 |
| 87 // Sets the manager to |manager| and sets |manager|'s external delegate | 86 // Sets the manager to |manager| and sets |manager|'s external delegate |
| 88 // to |autofill_external_delegate_|. Takes ownership of |manager|. | 87 // to |autofill_external_delegate_|. Takes ownership of |manager|. |
| 89 void SetAutofillManager(scoped_ptr<AutofillManager> manager); | 88 void SetAutofillManager(scoped_ptr<AutofillManager> manager); |
| 90 | 89 |
| 91 private: | 90 private: |
| 92 // AutofillManager instance via which this object drives the shared Autofill | 91 // AutofillManager instance via which this object drives the shared Autofill |
| 93 // code. | 92 // code. |
| 94 scoped_ptr<AutofillManager> autofill_manager_; | 93 scoped_ptr<AutofillManager> autofill_manager_; |
| 95 | 94 |
| 96 // AutofillExternalDelegate instance that this object instantiates in the | 95 // AutofillExternalDelegate instance that this object instantiates in the |
| 97 // case where the Autofill native UI is enabled. | 96 // case where the Autofill native UI is enabled. |
| 98 AutofillExternalDelegate autofill_external_delegate_; | 97 AutofillExternalDelegate autofill_external_delegate_; |
| 99 | 98 |
| 100 // Driver for the interactive autocomplete dialog. | 99 // Driver for the interactive autocomplete dialog. |
| 101 RequestAutocompleteManager request_autocomplete_manager_; | 100 RequestAutocompleteManager request_autocomplete_manager_; |
| 102 }; | 101 }; |
| 103 | 102 |
| 104 } // namespace autofill | 103 } // namespace autofill |
| 105 | 104 |
| 106 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_CONTENT_AUTOFILL_DRIVER_H_ | 105 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_CONTENT_AUTOFILL_DRIVER_H_ |
| OLD | NEW |