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 #include "components/autofill/ios/browser/autofill_driver_ios.h" | 5 #include "components/autofill/ios/browser/autofill_driver_ios.h" |
6 | 6 |
| 7 #include "base/memory/ptr_util.h" |
7 #include "components/autofill/ios/browser/autofill_driver_ios_bridge.h" | 8 #include "components/autofill/ios/browser/autofill_driver_ios_bridge.h" |
8 #include "ios/web/public/browser_state.h" | 9 #include "ios/web/public/browser_state.h" |
9 #import "ios/web/public/origin_util.h" | 10 #import "ios/web/public/origin_util.h" |
10 #include "ios/web/public/web_state/web_state.h" | 11 #include "ios/web/public/web_state/web_state.h" |
11 #include "ios/web/public/web_thread.h" | 12 #include "ios/web/public/web_thread.h" |
12 #include "ui/gfx/geometry/rect_f.h" | 13 #include "ui/gfx/geometry/rect_f.h" |
13 | 14 |
14 DEFINE_WEB_STATE_USER_DATA_KEY(autofill::AutofillDriverIOS); | 15 DEFINE_WEB_STATE_USER_DATA_KEY(autofill::AutofillDriverIOS); |
15 | 16 |
16 namespace autofill { | 17 namespace autofill { |
17 | 18 |
18 // static | 19 // static |
19 void AutofillDriverIOS::CreateForWebStateAndDelegate( | 20 void AutofillDriverIOS::CreateForWebStateAndDelegate( |
20 web::WebState* web_state, | 21 web::WebState* web_state, |
21 AutofillClient* client, | 22 AutofillClient* client, |
22 id<AutofillDriverIOSBridge> bridge, | 23 id<AutofillDriverIOSBridge> bridge, |
23 const std::string& app_locale, | 24 const std::string& app_locale, |
24 AutofillManager::AutofillDownloadManagerState enable_download_manager) { | 25 AutofillManager::AutofillDownloadManagerState enable_download_manager) { |
25 if (FromWebState(web_state)) | 26 if (FromWebState(web_state)) |
26 return; | 27 return; |
27 | 28 |
28 web_state->SetUserData( | 29 web_state->SetUserData( |
29 UserDataKey(), | 30 UserDataKey(), |
30 new AutofillDriverIOS(web_state, client, bridge, app_locale, | 31 base::WrapUnique(new AutofillDriverIOS( |
31 enable_download_manager)); | 32 web_state, client, bridge, app_locale, enable_download_manager))); |
32 } | 33 } |
33 | 34 |
34 AutofillDriverIOS::AutofillDriverIOS( | 35 AutofillDriverIOS::AutofillDriverIOS( |
35 web::WebState* web_state, | 36 web::WebState* web_state, |
36 AutofillClient* client, | 37 AutofillClient* client, |
37 id<AutofillDriverIOSBridge> bridge, | 38 id<AutofillDriverIOSBridge> bridge, |
38 const std::string& app_locale, | 39 const std::string& app_locale, |
39 AutofillManager::AutofillDownloadManagerState enable_download_manager) | 40 AutofillManager::AutofillDownloadManagerState enable_download_manager) |
40 : web_state_(web_state), | 41 : web_state_(web_state), |
41 bridge_(bridge), | 42 bridge_(bridge), |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 105 |
105 void AutofillDriverIOS::PopupHidden() { | 106 void AutofillDriverIOS::PopupHidden() { |
106 } | 107 } |
107 | 108 |
108 gfx::RectF AutofillDriverIOS::TransformBoundingBoxToViewportCoordinates( | 109 gfx::RectF AutofillDriverIOS::TransformBoundingBoxToViewportCoordinates( |
109 const gfx::RectF& bounding_box) { | 110 const gfx::RectF& bounding_box) { |
110 return bounding_box; | 111 return bounding_box; |
111 } | 112 } |
112 | 113 |
113 } // namespace autofill | 114 } // namespace autofill |
OLD | NEW |