| 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_IOS_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IOS_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IOS_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IOS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "components/autofill/core/browser/autofill_client.h" | 10 #include "components/autofill/core/browser/autofill_client.h" |
| 11 #include "components/autofill/core/browser/autofill_driver.h" | 11 #include "components/autofill/core/browser/autofill_driver.h" |
| 12 #include "components/autofill/core/browser/autofill_external_delegate.h" | 12 #include "components/autofill/core/browser/autofill_external_delegate.h" |
| 13 #include "components/autofill/core/browser/autofill_manager.h" | 13 #include "components/autofill/core/browser/autofill_manager.h" |
| 14 #include "ios/web/public/web_state/web_state_user_data.h" | 14 #include "ios/web/public/web_state/web_state_user_data.h" |
| 15 | 15 |
| 16 namespace web { | 16 namespace web { |
| 17 class WebState; | 17 class WebState; |
| 18 } | 18 } |
| 19 | 19 |
| 20 @protocol AutofillDriverIOSBridge; | 20 @protocol AutofillDriverIOSBridge; |
| 21 | 21 |
| 22 namespace autofill { | 22 namespace autofill { |
| 23 | 23 |
| 24 // Class that drives autofill flow on iOS. There is one instance per | 24 // Class that drives autofill flow on iOS. There is one instance per |
| 25 // WebContents. | 25 // WebContents. |
| 26 class AutofillDriverIOS : public AutofillDriver, | 26 class AutofillDriverIOS : public AutofillDriver, |
| 27 public web::WebStateUserData<AutofillDriverIOS> { | 27 public web::WebStateUserData<AutofillDriverIOS> { |
| 28 public: | 28 public: |
| 29 ~AutofillDriverIOS() override; |
| 30 |
| 29 static void CreateForWebStateAndDelegate( | 31 static void CreateForWebStateAndDelegate( |
| 30 web::WebState* web_state, | 32 web::WebState* web_state, |
| 31 AutofillClient* client, | 33 AutofillClient* client, |
| 32 id<AutofillDriverIOSBridge> bridge, | 34 id<AutofillDriverIOSBridge> bridge, |
| 33 const std::string& app_locale, | 35 const std::string& app_locale, |
| 34 AutofillManager::AutofillDownloadManagerState enable_download_manager); | 36 AutofillManager::AutofillDownloadManagerState enable_download_manager); |
| 35 | 37 |
| 36 // AutofillDriver: | 38 // AutofillDriver: |
| 37 bool IsIncognito() const override; | 39 bool IsIncognito() const override; |
| 38 net::URLRequestContextGetter* GetURLRequestContext() override; | 40 net::URLRequestContextGetter* GetURLRequestContext() override; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 60 gfx::RectF TransformBoundingBoxToViewportCoordinates( | 62 gfx::RectF TransformBoundingBoxToViewportCoordinates( |
| 61 const gfx::RectF& bounding_box) override; | 63 const gfx::RectF& bounding_box) override; |
| 62 | 64 |
| 63 private: | 65 private: |
| 64 AutofillDriverIOS( | 66 AutofillDriverIOS( |
| 65 web::WebState* web_state, | 67 web::WebState* web_state, |
| 66 AutofillClient* client, | 68 AutofillClient* client, |
| 67 id<AutofillDriverIOSBridge> bridge, | 69 id<AutofillDriverIOSBridge> bridge, |
| 68 const std::string& app_locale, | 70 const std::string& app_locale, |
| 69 AutofillManager::AutofillDownloadManagerState enable_download_manager); | 71 AutofillManager::AutofillDownloadManagerState enable_download_manager); |
| 70 ~AutofillDriverIOS() override; | |
| 71 | 72 |
| 72 // The WebState with which this object is associated. | 73 // The WebState with which this object is associated. |
| 73 web::WebState* web_state_; | 74 web::WebState* web_state_; |
| 74 | 75 |
| 75 // AutofillDriverIOSBridge instance that is passed in. | 76 // AutofillDriverIOSBridge instance that is passed in. |
| 76 id<AutofillDriverIOSBridge> bridge_; | 77 id<AutofillDriverIOSBridge> bridge_; |
| 77 | 78 |
| 78 // AutofillManager instance via which this object drives the shared Autofill | 79 // AutofillManager instance via which this object drives the shared Autofill |
| 79 // code. | 80 // code. |
| 80 AutofillManager autofill_manager_; | 81 AutofillManager autofill_manager_; |
| 81 // AutofillExternalDelegate instance that is passed to the AutofillManager. | 82 // AutofillExternalDelegate instance that is passed to the AutofillManager. |
| 82 AutofillExternalDelegate autofill_external_delegate_; | 83 AutofillExternalDelegate autofill_external_delegate_; |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 } // namespace autofill | 86 } // namespace autofill |
| 86 | 87 |
| 87 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IOS_H_ | 88 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IOS_H_ |
| OLD | NEW |