From 93c9bdcd60d420d3e79f8dfa9ae47b53780774dd Mon Sep 17 00:00:00 2001 From: brave-builds Date: Wed, 10 Jan 2024 10:07:57 +0000 Subject: [PATCH] Uplift of #21511 (squashed) to beta --- ios/app/BUILD.gn | 1 + ios/app/DEPS | 1 + ios/app/brave_core_main.mm | 5 +++++ .../application_context/brave_application_context_impl.h | 1 - .../application_context/brave_application_context_impl.mm | 4 ---- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ios/app/BUILD.gn b/ios/app/BUILD.gn index 5847b8002505..eac8e33b267e 100644 --- a/ios/app/BUILD.gn +++ b/ios/app/BUILD.gn @@ -61,6 +61,7 @@ source_set("app") { "//components/history/core/browser", "//components/keyed_service/core", "//components/password_manager/core/browser", + "//components/safe_browsing/core/common:safe_browsing_prefs", "//components/send_tab_to_self", "//components/sync/base", "//components/sync/service", diff --git a/ios/app/DEPS b/ios/app/DEPS index d7745c59a192..a4fcc61a615e 100644 --- a/ios/app/DEPS +++ b/ios/app/DEPS @@ -15,6 +15,7 @@ include_rules = [ "+components/history/core/browser", "+components/keyed_service/core", "+components/password_manager/core", + "+components/safe_browsing/core/common/safe_browsing_prefs.h", "+components/send_tab_to_self", "+ios/public/provider/chrome/browser/chrome_browser_provider.h", "+ios/public/provider/chrome/browser/overrides/overrides_api.h", diff --git a/ios/app/brave_core_main.mm b/ios/app/brave_core_main.mm index 6612a2b8c0f0..e7b5a164941f 100644 --- a/ios/app/brave_core_main.mm +++ b/ios/app/brave_core_main.mm @@ -49,6 +49,7 @@ #include "components/keyed_service/core/service_access_type.h" #include "components/password_manager/core/browser/password_store.h" #include "components/prefs/pref_service.h" +#include "components/safe_browsing/core/common/safe_browsing_prefs.h" #include "components/send_tab_to_self/send_tab_to_self_sync_service.h" #include "ios/chrome/app/startup/provider_registration.h" #include "ios/chrome/browser/bookmarks/model/bookmark_undo_service_factory.h" @@ -202,6 +203,10 @@ - (instancetype)initWithUserAgent:(NSString*)userAgent browserStateManager->GetLastUsedBrowserState(); _mainBrowserState = chromeBrowserState; + // Disable Safe-Browsing via Prefs + chromeBrowserState->GetPrefs()->SetBoolean(prefs::kSafeBrowsingEnabled, + false); + // Setup main browser _browserList = BrowserListFactory::GetForBrowserState(_mainBrowserState); _browser = Browser::Create(_mainBrowserState); diff --git a/ios/browser/application_context/brave_application_context_impl.h b/ios/browser/application_context/brave_application_context_impl.h index ac03b18d13a1..ef0859d7d15d 100644 --- a/ios/browser/application_context/brave_application_context_impl.h +++ b/ios/browser/application_context/brave_application_context_impl.h @@ -36,7 +36,6 @@ class BraveApplicationContextImpl : public ApplicationContextImpl { // ApplicationContextImpl ukm::UkmRecorder* GetUkmRecorder() override; - SafeBrowsingService* GetSafeBrowsingService() override; BrowserPolicyConnectorIOS* GetBrowserPolicyConnector() override; gcm::GCMDriver* GetGCMDriver() override; diff --git a/ios/browser/application_context/brave_application_context_impl.mm b/ios/browser/application_context/brave_application_context_impl.mm index b904a2e3d132..ba5ad0c0cb7a 100644 --- a/ios/browser/application_context/brave_application_context_impl.mm +++ b/ios/browser/application_context/brave_application_context_impl.mm @@ -35,10 +35,6 @@ return nullptr; } -SafeBrowsingService* BraveApplicationContextImpl::GetSafeBrowsingService() { - return nullptr; -} - BrowserPolicyConnectorIOS* BraveApplicationContextImpl::GetBrowserPolicyConnector() { return nullptr;