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_IOS_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IOS_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "components/autofill/core/browser/autofill_client.h" |
| 11 #include "components/autofill/core/browser/autofill_driver.h" |
| 12 #include "components/autofill/core/browser/autofill_external_delegate.h" |
| 13 #include "components/autofill/core/browser/autofill_manager.h" |
| 14 #include "ios/web/public/web_state/web_state_user_data.h" |
| 15 |
| 16 namespace web { |
| 17 class WebState; |
| 18 } |
| 19 |
| 20 @protocol AutofillDriverIOSBridge; |
| 21 |
| 22 namespace autofill { |
| 23 |
| 24 class AutofillManagerDelegate; |
| 25 |
| 26 // Class that drives autofill flow on iOS. There is one instance per |
| 27 // WebContents. |
| 28 class AutofillDriverIOS : public AutofillDriver, |
| 29 public web::WebStateUserData<AutofillDriverIOS> { |
| 30 public: |
| 31 static void CreateForWebStateAndDelegate( |
| 32 web::WebState* web_state, |
| 33 AutofillClient* client, |
| 34 id<AutofillDriverIOSBridge> bridge, |
| 35 const std::string& app_locale, |
| 36 AutofillManager::AutofillDownloadManagerState enable_download_manager); |
| 37 |
| 38 // AutofillDriver: |
| 39 bool IsOffTheRecord() const override; |
| 40 net::URLRequestContextGetter* GetURLRequestContext() override; |
| 41 bool RendererIsAvailable() override; |
| 42 void SendFormDataToRenderer(int query_id, |
| 43 RendererFormDataAction action, |
| 44 const FormData& data) override; |
| 45 void PingRenderer() override; |
| 46 void DetectAccountCreationForms( |
| 47 const std::vector<autofill::FormStructure*>& forms) override; |
| 48 void SendAutofillTypePredictionsToRenderer( |
| 49 const std::vector<FormStructure*>& forms) override; |
| 50 void RendererShouldClearFilledForm() override; |
| 51 void RendererShouldClearPreviewedForm() override; |
| 52 void RendererShouldAcceptDataListSuggestion( |
| 53 const base::string16& value) override; |
| 54 base::SequencedWorkerPool* GetBlockingPool() override; |
| 55 |
| 56 AutofillManager* autofill_manager() { return &autofill_manager_; } |
| 57 |
| 58 void RendererShouldFillFieldWithValue(const base::string16& value) override; |
| 59 void RendererShouldPreviewFieldWithValue( |
| 60 const base::string16& value) override; |
| 61 void PopupHidden() override; |
| 62 |
| 63 private: |
| 64 AutofillDriverIOS( |
| 65 web::WebState* web_state, |
| 66 AutofillClient* client, |
| 67 id<AutofillDriverIOSBridge> bridge, |
| 68 const std::string& app_locale, |
| 69 AutofillManager::AutofillDownloadManagerState enable_download_manager); |
| 70 ~AutofillDriverIOS() override; |
| 71 |
| 72 // The WebState with which this object is associated. |
| 73 web::WebState* web_state_; |
| 74 |
| 75 // AutofillDriverIOSBridge instance that is passed in. |
| 76 id<AutofillDriverIOSBridge> bridge_; |
| 77 |
| 78 // AutofillManager instance via which this object drives the shared Autofill |
| 79 // code. |
| 80 AutofillManager autofill_manager_; |
| 81 // AutofillExternalDelegate instance that is passed to the AutofillManager. |
| 82 AutofillExternalDelegate autofill_external_delegate_; |
| 83 }; |
| 84 |
| 85 } // namespace autofill |
| 86 |
| 87 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IOS_H_ |
OLD | NEW |