Skip to content

Commit

Permalink
Merge pull request #20415 from brave/cr118-followup-fix-autofill-clie…
Browse files Browse the repository at this point in the history
…nt-crash

Fix autofill related crash due to our disabling of optimization hints
  • Loading branch information
emerick authored Oct 5, 2023
2 parents 294d6f6 + 9c1cfea commit 3e93095
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
// You can obtain one at https://mozilla.org/MPL/2.0/.

#include "chrome/browser/ui/autofill/chrome_autofill_client.h"

#include "base/memory/ptr_util.h"
#include "brave/components/constants/pref_names.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/autofill/payments/webauthn_dialog_controller_impl.h"
#include "chrome/browser/ui/page_info/page_info_dialog.h"
#include "components/optimization_guide/core/optimization_guide_features.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"

namespace autofill {
Expand All @@ -34,6 +36,13 @@ class BraveChromeAutofillClient : public ChromeAutofillClient {
public:
using ChromeAutofillClient::ChromeAutofillClient;

AutofillOptimizationGuide* GetAutofillOptimizationGuide() const override {
if (optimization_guide::features::IsOptimizationHintsEnabled()) {
return ChromeAutofillClient::GetAutofillOptimizationGuide();
}
return nullptr;
}

bool IsAutocompleteEnabled() const override {
auto enabled = ChromeAutofillClient::IsAutocompleteEnabled();
if (!IsPrivateProfile(web_contents())) {
Expand Down

0 comments on commit 3e93095

Please sign in to comment.