Skip to content

Commit

Permalink
[iOS] - Fix #34752: Add Variations Support (#21283)
Browse files Browse the repository at this point in the history
- Add Variations Support for iOS
  • Loading branch information
Brandon-T authored and tmancey committed Jan 29, 2024
1 parent a6dce93 commit 0dbcac3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
1 change: 0 additions & 1 deletion build/commands/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 2 additions & 0 deletions ios/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
9 changes: 5 additions & 4 deletions ios/app/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 16 additions & 0 deletions ios/app/brave_main_delegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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");
}
Expand Down

0 comments on commit 0dbcac3

Please sign in to comment.