From dc769c43d68ba32f870dc8ce426d5e79ffd4054f Mon Sep 17 00:00:00 2001 From: Kyle Hickinson Date: Thu, 30 Apr 2026 10:28:23 -0400 Subject: [PATCH] [iOS] Fix access of autofill controller in BraveWebView (#35899) This updates the chromium_src overrides that enable the usage of `CWVAutofillController`, namely removing logic in the `WebView*` types that use `WebViewBrowserState` rather than a dependency injected into the client. This means creating a few new overrides for `IOSWebViewPaymentsAutofillClient` and supplying a different autofill client bridge/driver for the `CWVAutofillController` (via subclass) --- .../autofill/cwv_autofill_controller.mm | 44 --- .../cwv_autofill_controller_internal.h | 32 -- .../ios_web_view_payments_autofill_client.h | 42 +++ .../ios_web_view_payments_autofill_client.mm | 22 ++ .../autofill/web_view_autofill_client_ios.h | 23 ++ ios/browser/api/web_view/autofill/BUILD.gn | 2 + .../autofill/brave_autofill_controller.h | 20 ++ .../autofill/brave_autofill_controller.mm | 299 ++++++++++++++++++ ios/browser/api/web_view/brave_web_view.mm | 5 +- 9 files changed, 410 insertions(+), 79 deletions(-) delete mode 100644 chromium_src/ios/web_view/internal/autofill/cwv_autofill_controller.mm delete mode 100644 chromium_src/ios/web_view/internal/autofill/cwv_autofill_controller_internal.h create mode 100644 chromium_src/ios/web_view/internal/autofill/ios_web_view_payments_autofill_client.h create mode 100644 chromium_src/ios/web_view/internal/autofill/ios_web_view_payments_autofill_client.mm create mode 100644 chromium_src/ios/web_view/internal/autofill/web_view_autofill_client_ios.h create mode 100644 ios/browser/api/web_view/autofill/brave_autofill_controller.h create mode 100644 ios/browser/api/web_view/autofill/brave_autofill_controller.mm diff --git a/chromium_src/ios/web_view/internal/autofill/cwv_autofill_controller.mm b/chromium_src/ios/web_view/internal/autofill/cwv_autofill_controller.mm deleted file mode 100644 index dc5505adbd0..00000000000 --- a/chromium_src/ios/web_view/internal/autofill/cwv_autofill_controller.mm +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2025 The Brave Authors. All rights reserved. -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this file, -// You can obtain one at https://mozilla.org/MPL/2.0/. - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnullability-completeness" - -#include - -#include "base/functional/callback_forward.h" -#include "components/autofill/ios/browser/autofill_client_ios.h" -#include "ios/web/public/web_state.h" -#include "ios/web_view/internal/autofill/cwv_autofill_client_ios_bridge.h" -#include "ios/web_view/internal/autofill/cwv_autofill_controller_internal.h" -#include "ios/web_view/internal/autofill/web_view_autofill_client_ios.h" - -#include - -@implementation CWVAutofillController (Internal) -- (instancetype) - initWithWebState:(web::WebState*)webState - createAutofillClient:(CreateAutofillClientCallback)createAutofillClient - autofillAgent:(AutofillAgent*)autofillAgent - passwordManager:(std::unique_ptr) - passwordManager - passwordManagerClient: - (std::unique_ptr) - passwordManagerClient - passwordController:(SharedPasswordController*)passwordController { - self = [self initWithWebState:webState - autofillClientForTest:createAutofillClient.Run(webState, nil) - autofillAgent:autofillAgent - passwordManager:std::move(passwordManager) - passwordManagerClient:std::move(passwordManagerClient) - passwordController:passwordController]; - // Overwrite the autofill client with one that has a valid bridge arg - _autofillClient = createAutofillClient.Run(webState, self); - return self; -} - -@end - -#pragma clang diagnostic pop diff --git a/chromium_src/ios/web_view/internal/autofill/cwv_autofill_controller_internal.h b/chromium_src/ios/web_view/internal/autofill/cwv_autofill_controller_internal.h deleted file mode 100644 index 930b0889971..00000000000 --- a/chromium_src/ios/web_view/internal/autofill/cwv_autofill_controller_internal.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2025 The Brave Authors. All rights reserved. -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this file, -// You can obtain one at https://mozilla.org/MPL/2.0/. - -#ifndef BRAVE_CHROMIUM_SRC_IOS_WEB_VIEW_INTERNAL_AUTOFILL_CWV_AUTOFILL_CONTROLLER_INTERNAL_H_ -#define BRAVE_CHROMIUM_SRC_IOS_WEB_VIEW_INTERNAL_AUTOFILL_CWV_AUTOFILL_CONTROLLER_INTERNAL_H_ - -#include // IWYU pragma: export - -using CreateAutofillClientCallback = - base::RepeatingCallback( - web::WebState*, - id)>; - -// Expose a way to create an CWVAutofillController with a explicit -// WebViewAutofillClientIOS so we can avoid it making one with WebView factories -@interface CWVAutofillController (Internal) -- (instancetype)initWithWebState:(web::WebState*)webState - createAutofillClient: - (CreateAutofillClientCallback)createAutofillClientCallback - autofillAgent:(AutofillAgent*)autofillAgent - passwordManager: - (std::unique_ptr) - passwordManager - passwordManagerClient: - (std::unique_ptr) - passwordManagerClient - passwordController:(SharedPasswordController*)passwordController; -@end - -#endif // BRAVE_CHROMIUM_SRC_IOS_WEB_VIEW_INTERNAL_AUTOFILL_CWV_AUTOFILL_CONTROLLER_INTERNAL_H_ diff --git a/chromium_src/ios/web_view/internal/autofill/ios_web_view_payments_autofill_client.h b/chromium_src/ios/web_view/internal/autofill/ios_web_view_payments_autofill_client.h new file mode 100644 index 00000000000..796ec46e309 --- /dev/null +++ b/chromium_src/ios/web_view/internal/autofill/ios_web_view_payments_autofill_client.h @@ -0,0 +1,42 @@ +// Copyright (c) 2026 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. + +#ifndef BRAVE_CHROMIUM_SRC_IOS_WEB_VIEW_INTERNAL_AUTOFILL_IOS_WEB_VIEW_PAYMENTS_AUTOFILL_CLIENT_H_ +#define BRAVE_CHROMIUM_SRC_IOS_WEB_VIEW_INTERNAL_AUTOFILL_IOS_WEB_VIEW_PAYMENTS_AUTOFILL_CLIENT_H_ + +// This override adds a subclass of IOSWebViewPaymentsAutofillClient which +// supports passing in a PrefService dependency directly rather than go through +// WebViewBrowserState which is unavailable for our usages of CWVWebView +#define client_ \ + client_; \ + friend class BraveIOSWebViewPaymentsAutofillClient +#define GetPrefService \ + Unused(); \ + virtual PrefService* GetPrefService + +#include // IWYU pragma: export + +#undef GetPrefService +#undef client_ + +namespace autofill::payments { + +class BraveIOSWebViewPaymentsAutofillClient + : public IOSWebViewPaymentsAutofillClient { + public: + explicit BraveIOSWebViewPaymentsAutofillClient( + autofill::WebViewAutofillClientIOS* client, + id bridge, + web::WebState* web_state, + PrefService* pref_service); + + private: + raw_ptr pref_service_; + PrefService* GetPrefService() const override; +}; + +} // namespace autofill::payments + +#endif // BRAVE_CHROMIUM_SRC_IOS_WEB_VIEW_INTERNAL_AUTOFILL_IOS_WEB_VIEW_PAYMENTS_AUTOFILL_CLIENT_H_ diff --git a/chromium_src/ios/web_view/internal/autofill/ios_web_view_payments_autofill_client.mm b/chromium_src/ios/web_view/internal/autofill/ios_web_view_payments_autofill_client.mm new file mode 100644 index 00000000000..f44db8d0111 --- /dev/null +++ b/chromium_src/ios/web_view/internal/autofill/ios_web_view_payments_autofill_client.mm @@ -0,0 +1,22 @@ +// Copyright (c) 2026 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. + +#include + +namespace autofill::payments { + +BraveIOSWebViewPaymentsAutofillClient::BraveIOSWebViewPaymentsAutofillClient( + autofill::WebViewAutofillClientIOS* client, + id bridge, + web::WebState* web_state, + PrefService* pref_service) + : IOSWebViewPaymentsAutofillClient(client, bridge, web_state), + pref_service_(pref_service) {} + +PrefService* BraveIOSWebViewPaymentsAutofillClient::GetPrefService() const { + return pref_service_; +} + +} // namespace autofill::payments diff --git a/chromium_src/ios/web_view/internal/autofill/web_view_autofill_client_ios.h b/chromium_src/ios/web_view/internal/autofill/web_view_autofill_client_ios.h new file mode 100644 index 00000000000..7818cbc702b --- /dev/null +++ b/chromium_src/ios/web_view/internal/autofill/web_view_autofill_client_ios.h @@ -0,0 +1,23 @@ +// Copyright (c) 2026 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. + +#ifndef BRAVE_CHROMIUM_SRC_IOS_WEB_VIEW_INTERNAL_AUTOFILL_WEB_VIEW_AUTOFILL_CLIENT_IOS_H_ +#define BRAVE_CHROMIUM_SRC_IOS_WEB_VIEW_INTERNAL_AUTOFILL_WEB_VIEW_AUTOFILL_CLIENT_IOS_H_ + +#include "components/autofill/ios/browser/autofill_client_ios.h" +#include "ios/web_view/internal/autofill/ios_web_view_payments_autofill_client.h" + +// This override replaces the IOSWebViewPaymentsAutofillClient with the +// BraveIOSWebViewPaymentsAutofillClient subclass and passes in the +// pref_service_ of the current WebViewAutofillClient into it +#define IOSWebViewPaymentsAutofillClient BraveIOSWebViewPaymentsAutofillClient +#define web_state() web_state(), pref_service_ + +#include // IWYU pragma: export + +#undef web_state +#undef IOSWebViewPaymentsAutofillClient + +#endif // BRAVE_CHROMIUM_SRC_IOS_WEB_VIEW_INTERNAL_AUTOFILL_WEB_VIEW_AUTOFILL_CLIENT_IOS_H_ diff --git a/ios/browser/api/web_view/autofill/BUILD.gn b/ios/browser/api/web_view/autofill/BUILD.gn index 5093a62bad8..e67dd59ac47 100644 --- a/ios/browser/api/web_view/autofill/BUILD.gn +++ b/ios/browser/api/web_view/autofill/BUILD.gn @@ -15,6 +15,8 @@ source_set("autofill") { sources = [ "autofill_credit_card_util.h", "autofill_credit_card_util.mm", + "brave_autofill_controller.h", + "brave_autofill_controller.mm", "brave_web_view_autofill_client.h", "brave_web_view_autofill_client.mm", ] diff --git a/ios/browser/api/web_view/autofill/brave_autofill_controller.h b/ios/browser/api/web_view/autofill/brave_autofill_controller.h new file mode 100644 index 00000000000..e0dd4516a8a --- /dev/null +++ b/ios/browser/api/web_view/autofill/brave_autofill_controller.h @@ -0,0 +1,20 @@ +// Copyright (c) 2026 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. + +#ifndef BRAVE_IOS_BROWSER_API_WEB_VIEW_AUTOFILL_BRAVE_AUTOFILL_CONTROLLER_H_ +#define BRAVE_IOS_BROWSER_API_WEB_VIEW_AUTOFILL_BRAVE_AUTOFILL_CONTROLLER_H_ + +#import + +#include "ios/web_view/public/cwv_autofill_controller.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface BraveAutofillController : CWVAutofillController +@end + +NS_ASSUME_NONNULL_END + +#endif // BRAVE_IOS_BROWSER_API_WEB_VIEW_AUTOFILL_BRAVE_AUTOFILL_CONTROLLER_H_ diff --git a/ios/browser/api/web_view/autofill/brave_autofill_controller.mm b/ios/browser/api/web_view/autofill/brave_autofill_controller.mm new file mode 100644 index 00000000000..485c454ff52 --- /dev/null +++ b/ios/browser/api/web_view/autofill/brave_autofill_controller.mm @@ -0,0 +1,299 @@ +// Copyright (c) 2026 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. + +#include "brave/ios/browser/api/web_view/autofill/brave_autofill_controller.h" + +#import + +#include + +#include "base/functional/callback_forward.h" +#include "base/notimplemented.h" +#include "base/strings/sys_string_conversions.h" +#include "brave/ios/browser/api/web_view/autofill/brave_web_view_autofill_client.h" +#include "components/autofill/core/browser/foundations/autofill_client.h" +#include "components/autofill/core/browser/ui/payments/card_unmask_prompt_options.h" +#include "components/autofill/ios/browser/autofill_agent.h" +#include "components/autofill/ios/browser/autofill_client_ios_bridge.h" +#include "components/autofill/ios/browser/autofill_driver_ios_bridge.h" +#include "ios/web_view/internal/autofill/cwv_autofill_client_ios_bridge.h" +#include "ios/web_view/internal/autofill/cwv_autofill_controller+testing.h" +#include "ios/web_view/internal/autofill/cwv_autofill_controller_internal.h" +#include "ios/web_view/internal/autofill/cwv_autofill_form_internal.h" +#include "ios/web_view/internal/autofill/cwv_autofill_profile_internal.h" +#include "ios/web_view/public/cwv_autofill_controller_delegate.h" +#include "ios/web_view/public/cwv_autofill_form.h" +#include "ios/web_view/public/cwv_autofill_profile.h" +#include "ios/web_view/public/cwv_autofill_suggestion.h" + +using UserDecision = autofill::AutofillClient::AddressPromptUserDecision; + +@interface BraveAutofillClientBridge + : NSObject +@property(nonatomic, weak) AutofillAgent* autofillAgent; +@property(nonatomic, weak) BraveAutofillController* autofillController; +- (instancetype)initWithAutofillAgent:(AutofillAgent*)autofillAgent; +@end + +@interface BraveAutofillController () +@property(nonatomic) BraveAutofillClientBridge* bridge; +@end + +@implementation BraveAutofillController + +- (instancetype)initWithWebState:(web::WebState*)webState + autofillAgent:(AutofillAgent*)autofillAgent + passwordManager: + (std::unique_ptr) + passwordManager + passwordManagerClient: + (std::unique_ptr) + passwordManagerClient + passwordController:(SharedPasswordController*)passwordController { + BraveAutofillClientBridge* bridge = + [[BraveAutofillClientBridge alloc] initWithAutofillAgent:autofillAgent]; + self = + [super initWithWebState:webState + autofillClientForTest:autofill::BraveWebViewAutofillClientIOS::Create( + webState, bridge) + autofillAgent:autofillAgent + passwordManager:std::move(passwordManager) + passwordManagerClient:std::move(passwordManagerClient) + passwordController:passwordController]; + self.bridge = bridge; + bridge.autofillController = self; + return self; +} + +@end + +@implementation BraveAutofillClientBridge + +- (instancetype)initWithAutofillAgent:(AutofillAgent*)autofillAgent { + if ((self = [super init])) { + _autofillAgent = autofillAgent; + } + return self; +} + +#pragma mark - AutofillClientIOSBridge + +- (void)showAutofillPopup:(const std::vector&)suggestions + suggestionDelegate: + (const base::WeakPtr&) + delegate { + // We only want Autofill suggestions. + std::vector filtered_suggestions; + std::ranges::copy_if( + suggestions, std::back_inserter(filtered_suggestions), + [](const autofill::Suggestion& suggestion) { + return suggestion.type == autofill::SuggestionType::kAddressEntry || + suggestion.type == autofill::SuggestionType::kCreditCardEntry; + }); + [_autofillAgent showAutofillPopup:filtered_suggestions + suggestionDelegate:delegate]; +} + +- (void)hideAutofillPopup { + [_autofillAgent hideAutofillPopup]; +} + +- (bool)isLastQueriedField:(autofill::FieldGlobalId)fieldId { + return [_autofillAgent isLastQueriedField:fieldId]; +} + +- (void)showPlusAddressEmailOverrideNotification: + (base::OnceClosure)emailOverrideUndoCallback { + NOTIMPLEMENTED(); +} + +#pragma mark - AutofillDriverIOSBridge + +- (void)fillData:(const std::vector&)fields + section:(const autofill::Section&)section + inFrame:(web::WebFrame*)frame + withActionType:(autofill::mojom::FormActionType)actionType { + [_autofillAgent fillData:fields + section:section + inFrame:frame + withActionType:actionType]; +} + +- (void)fillSpecificFormField:(const autofill::FieldRendererId&)field + withValue:(const std::u16string)value + inFrame:(web::WebFrame*)frame { + NOTIMPLEMENTED(); +} + +- (void)handleParsedForms: + (const std::vector>&)forms + inFrame:(web::WebFrame*)frame { + if (![self.autofillController.delegate + respondsToSelector:@selector(autofillController: + didFindForms:frameID:)]) { + return; + } + + NSMutableArray* autofillForms = [NSMutableArray array]; + for (const raw_ref& form : forms) { + CWVAutofillForm* autofillForm = + [[CWVAutofillForm alloc] initWithFormStructure:*form]; + [autofillForms addObject:autofillForm]; + } + [self.autofillController.delegate + autofillController:self.autofillController + didFindForms:autofillForms + frameID:base::SysUTF8ToNSString(frame->GetFrameId())]; +} + +- (void)fillFormDataPredictions: + (const std::vector&)forms + inFrame:(web::WebFrame*)frame { + NOTIMPLEMENTED(); +} + +- (void)fetchFormsFiltered:(std::optional)formNameFilter + inFrame:(web::WebFrame*)frame + completionHandler:(FormFetchCompletion)completionHandler { + [_autofillAgent fetchFormsFiltered:std::move(formNameFilter) + inFrame:frame + completionHandler:std::move(completionHandler)]; +} + +- (void)notifyFormsSeen:(const std::vector&)updatedForms + inFrame:(web::WebFrame*)frame { + [_autofillAgent notifyFormsSeen:updatedForms inFrame:frame]; +} + +#pragma mark - CWVAutofillClientIOSBridge + +- (void) + showSaveCreditCardToCloud:(const autofill::CreditCard&)creditCard + legalMessageLines:(autofill::LegalMessageLines)legalMessageLines + saveCreditCardOptions: + (autofill::payments::PaymentsAutofillClient::SaveCreditCardOptions) + saveCreditCardOptions + callback:(autofill::payments::PaymentsAutofillClient:: + UploadSaveCardPromptCallback)callback { + NOTIMPLEMENTED(); +} + +- (void)handleCreditCardUploadCompleted:(BOOL)cardSaved + callback:(base::OnceClosure)callback { + NOTIMPLEMENTED(); +} + +- (void)showUnmaskPromptForCard:(const autofill::CreditCard&)creditCard + cardUnmaskPromptOptions: + (const autofill::CardUnmaskPromptOptions&)cardUnmaskPromptOptions + delegate:(base::WeakPtr) + delegate { + NOTIMPLEMENTED(); +} + +- (void)didReceiveUnmaskVerificationResult: + (autofill::payments::PaymentsAutofillClient::PaymentsRpcResult)result { + NOTIMPLEMENTED(); +} + +- (void)loadRiskData:(base::OnceCallback)callback { + NOTIMPLEMENTED(); +} + +- (void) + confirmSaveAddressProfile:(const autofill::AutofillProfile&)profile + originalProfile:(const autofill::AutofillProfile*)originalProfile + callback:(autofill::AutofillClient:: + AddressProfileSavePromptCallback)callback { + if ([self.autofillController.delegate + respondsToSelector:@selector + (autofillController: + confirmSaveForNewAutofillProfile:oldProfile:decisionHandler:)]) { + CWVAutofillProfile* newProfile = + [[CWVAutofillProfile alloc] initWithProfile:profile]; + CWVAutofillProfile* oldProfile = nil; + if (originalProfile) { + oldProfile = + [[CWVAutofillProfile alloc] initWithProfile:*originalProfile]; + } + __block auto scopedCallback = std::move(callback); + [self.autofillController.delegate + autofillController:self.autofillController + confirmSaveForNewAutofillProfile:newProfile + oldProfile:oldProfile + decisionHandler:^( + CWVAutofillProfileUserDecision decision) { + UserDecision userDecision; + switch (decision) { + case CWVAutofillProfileUserDecisionAccepted: + userDecision = UserDecision::kAccepted; + break; + case CWVAutofillProfileUserDecisionDeclined: + userDecision = UserDecision::kDeclined; + break; + case CWVAutofillProfileUserDecisionIgnored: + userDecision = UserDecision::kIgnored; + break; + } + std::move(scopedCallback) + .Run(userDecision, *newProfile.internalProfile); + }]; + } else { + std::move(callback).Run(UserDecision::kUserNotAsked, profile); + } +} + +- (void)showAutofillProgressDialogOfType:(autofill::AutofillProgressUiType)type + cancelCallback:(base::OnceClosure)cancelCallback { + NOTIMPLEMENTED(); +} + +- (void)closeAutofillProgressDialogWithConfirmation:(BOOL)showConfirmation + completionCallback: + (base::OnceClosure)callback { + NOTIMPLEMENTED(); +} + +- (void)showUnmaskAuthenticatorSelectorWithOptions: + (const std::vector&)options + acceptCallback: + (base::OnceCallback)acceptCallback + cancelCallback: + (base::OnceClosure)cancelCallback { + NOTIMPLEMENTED(); +} + +- (void)showVirtualCardEnrollmentWithEnrollmentFields: + (const autofill::VirtualCardEnrollmentFields&)enrollmentFields + acceptCallback: + (base::OnceClosure)acceptCallback + declineCallback: + (base::OnceClosure)declineCallback { + NOTIMPLEMENTED(); +} + +- (void)handleVirtualCardEnrollmentResult:(BOOL)cardEnrolled { + NOTIMPLEMENTED(); +} + +- (void)showCardUnmaskOtpInputDialogForCardType: + (autofill::CreditCard::RecordType)cardType + challengeOption: + (const autofill::CardUnmaskChallengeOption&) + challengeOption + delegate: + (base::WeakPtr< + autofill::OtpUnmaskDelegate>) + delegate { + NOTIMPLEMENTED(); +} + +- (void)didReceiveUnmaskOtpVerificationResult: + (autofill::OtpUnmaskResult)unmaskResult { + NOTIMPLEMENTED(); +} + +@end diff --git a/ios/browser/api/web_view/brave_web_view.mm b/ios/browser/api/web_view/brave_web_view.mm index b8abfd1b7c6..6c74d7157ef 100644 --- a/ios/browser/api/web_view/brave_web_view.mm +++ b/ios/browser/api/web_view/brave_web_view.mm @@ -21,6 +21,7 @@ #include "brave/ios/browser/ai_chat/ai_chat_ui_handler_bridge_holder.h" #include "brave/ios/browser/ai_chat/tab_data_web_state_observer.h" #include "brave/ios/browser/ai_chat/tab_tracker_service_factory.h" +#include "brave/ios/browser/api/web_view/autofill/brave_autofill_controller.h" #include "brave/ios/browser/api/web_view/autofill/brave_web_view_autofill_client.h" #include "brave/ios/browser/api/web_view/passwords/brave_web_view_password_manager_client.h" #include "brave/ios/browser/brave_ads/ads_tab_helper.h" @@ -445,10 +446,8 @@ class FaviconDriverObserver : public favicon::FaviconDriverObserver { formHelper:formHelper suggestionHelper:suggestionHelper driverHelper:driverHelper]; - return [[CWVAutofillController alloc] + return [[BraveAutofillController alloc] initWithWebState:self.webState - createAutofillClient: - base::BindRepeating(&autofill::BraveWebViewAutofillClientIOS::Create) autofillAgent:autofillAgent passwordManager:std::move(passwordManager) passwordManagerClient:std::move(passwordManagerClient)