diff --git a/build/commands/lib/config.js b/build/commands/lib/config.js index 5afa27140fbf..61eb9ce0981b 100644 --- a/build/commands/lib/config.js +++ b/build/commands/lib/config.js @@ -696,7 +696,6 @@ Config.prototype.buildArgs = function () { delete args.webcompat_report_api_endpoint delete args.use_blink_v8_binding_new_idl_interface delete args.v8_enable_verify_heap - delete args.brave_variations_server_url delete args.enable_dangling_raw_ptr_checks } diff --git a/chromium_src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.h b/chromium_src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.h deleted file mode 100644 index 6e02f058e74e..000000000000 --- a/chromium_src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.h +++ /dev/null @@ -1,18 +0,0 @@ -/* Copyright (c) 2022 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_CHROME_BROWSER_BROWSER_STATE_MODEL_CHROME_BROWSER_STATE_IMPL_H_ -#define BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_BROWSER_STATE_MODEL_CHROME_BROWSER_STATE_IMPL_H_ - -#include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" - -#define GetPolicyConnector \ - GetPolicyConnector_ChromiumImpl(); \ - BrowserStatePolicyConnector* GetPolicyConnector - -#include "src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.h" // IWYU pragma: export -#undef GetPolicyConnector - -#endif // BRAVE_CHROMIUM_SRC_IOS_CHROME_BROWSER_BROWSER_STATE_MODEL_CHROME_BROWSER_STATE_IMPL_H_ diff --git a/chromium_src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.mm b/chromium_src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.mm deleted file mode 100644 index 35edfff5535c..000000000000 --- a/chromium_src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.mm +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (c) 2022 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 "ios/chrome/browser/browser_state/model/chrome_browser_state_impl.h" - -#include "ios/chrome/browser/browser_state/model/off_the_record_chrome_browser_state_impl.h" -#include "ios/chrome/browser/policy/browser_policy_connector_ios.h" -#include "ios/chrome/browser/policy/browser_state_policy_connector.h" -#include "ios/chrome/browser/policy/browser_state_policy_connector_factory.h" -#include "ios/chrome/browser/shared/model/application_context/application_context.h" - -#define BrowserPolicyConnectorIOS \ - if (false) { \ - BrowserPolicyConnectorIOS - -#undef BuildBrowserStatePolicyConnector -#define BuildBrowserStatePolicyConnector(ARG1, ARG2, ARG3) \ - nullptr; \ - } - -#define GetPolicyConnector GetPolicyConnector_ChromiumImpl - -#include "src/ios/chrome/browser/browser_state/model/chrome_browser_state_impl.mm" - -#undef GetPolicyConnector -#undef BuildBrowserStatePolicyConnector -#undef BrowserPolicyConnectorIOS - -BrowserStatePolicyConnector* ChromeBrowserStateImpl::GetPolicyConnector() { - return nullptr; -} diff --git a/ios/app/BUILD.gn b/ios/app/BUILD.gn index 8585453ccba0..7db7203bb2cf 100644 --- a/ios/app/BUILD.gn +++ b/ios/app/BUILD.gn @@ -33,6 +33,7 @@ source_set("app") { "//brave/components/p3a:buildflags", "//brave/components/skus/browser", "//brave/components/update_client:buildflags", + "//brave/components/variations:constants", "//brave/ios/app/resources", "//brave/ios/browser", "//brave/ios/browser/api/ads", @@ -65,6 +66,7 @@ source_set("app") { "//components/send_tab_to_self", "//components/sync/base", "//components/sync/service", + "//components/variations", "//ios/chrome/app:app_internal", "//ios/chrome/app:tests_fake_hook", "//ios/chrome/app/startup:startup", diff --git a/ios/app/DEPS b/ios/app/DEPS index a4fcc61a615e..84d5bc5cbf6b 100644 --- a/ios/app/DEPS +++ b/ios/app/DEPS @@ -4,19 +4,20 @@ include_rules = [ "+ios/chrome/common", "+brave/ios/app", "+brave/ios/browser", + "+components/browser_sync", "+components/component_updater/component_updater_paths.h", "+components/component_updater/component_updater_service.h", "+components/component_updater/component_updater_switches.h", "+components/component_updater/installer_policies", - "+components/prefs", - "+components/sync/service", - "+components/sync/base", - "+components/browser_sync", "+components/history/core/browser", "+components/keyed_service/core", + "+components/prefs", "+components/password_manager/core", "+components/safe_browsing/core/common/safe_browsing_prefs.h", "+components/send_tab_to_self", + "+components/sync/base", + "+components/sync/service", + "+components/variations/variations_switches.h", "+ios/public/provider/chrome/browser/chrome_browser_provider.h", "+ios/public/provider/chrome/browser/overrides/overrides_api.h", "+ios/public/provider/chrome/browser/ui_utils/ui_utils_api.h", diff --git a/ios/app/brave_main_delegate.mm b/ios/app/brave_main_delegate.mm index 27df7b37204a..0fc0c8c81d05 100644 --- a/ios/app/brave_main_delegate.mm +++ b/ios/app/brave_main_delegate.mm @@ -16,10 +16,12 @@ #include "brave/components/brave_component_updater/browser/switches.h" #include "brave/components/brave_sync/buildflags.h" #include "brave/components/update_client/buildflags.h" +#include "brave/components/variations/buildflags.h" #include "components/browser_sync/browser_sync_switches.h" #include "components/component_updater/component_updater_switches.h" #include "components/sync/base/command_line_switches.h" #include "components/sync/base/model_type.h" +#include "components/variations/variations_switches.h" #include "ios/chrome/browser/flags/chrome_switches.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -70,6 +72,20 @@ @implementation BundleLookupClass BUILDFLAG(BRAVE_SYNC_ENDPOINT)); } + // Brave variations + if (!command_line->HasSwitch(variations::switches::kVariationsServerURL)) { + command_line->AppendSwitchASCII(variations::switches::kVariationsServerURL, + BUILDFLAG(BRAVE_VARIATIONS_SERVER_URL)); + + // Insecure fall-back for variations is set to the same (secure) URL. This + // is done so that if VariationsService tries to fall back to insecure url + // the check for kHttpScheme in VariationsService::MaybeRetryOverHTTP would + // prevent it from doing so as we don't want to use an insecure fall-back. + command_line->AppendSwitchASCII( + variations::switches::kVariationsInsecureServerURL, + BUILDFLAG(BRAVE_VARIATIONS_SERVER_URL)); + } + if (!command_line->HasSwitch(switches::kVModule)) { command_line->AppendSwitchASCII(switches::kVModule, "*/brave/*=0"); } diff --git a/ios/browser/application_context/brave_application_context_impl.h b/ios/browser/application_context/brave_application_context_impl.h index ef0859d7d15d..bb0cecd6f856 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; - BrowserPolicyConnectorIOS* GetBrowserPolicyConnector() override; gcm::GCMDriver* GetGCMDriver() override; // BraveApplicationContextImpl diff --git a/ios/browser/application_context/brave_application_context_impl.mm b/ios/browser/application_context/brave_application_context_impl.mm index ba5ad0c0cb7a..22fa36e4c02b 100644 --- a/ios/browser/application_context/brave_application_context_impl.mm +++ b/ios/browser/application_context/brave_application_context_impl.mm @@ -35,11 +35,6 @@ return nullptr; } -BrowserPolicyConnectorIOS* -BraveApplicationContextImpl::GetBrowserPolicyConnector() { - return nullptr; -} - gcm::GCMDriver* BraveApplicationContextImpl::GetGCMDriver() { return nullptr; }