Skip to content

Commit f512396

Browse files
committed
Extract locale country code for variations on first run
1 parent fb04cff commit f512396

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (c) 2025 The Brave Authors. All rights reserved.
2+
// This Source Code Form is subject to the terms of the Mozilla Public
3+
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
4+
// You can obtain one at https://mozilla.org/MPL/2.0/.
5+
6+
#include "base/strings/string_util.h"
7+
#include "brave/components/l10n/common/locale_util.h"
8+
9+
#define BRAVE_CHROME_FEATURE_LIST_CREATOR_SETUP_INITIAL_PREFS \
10+
if (!compressed_variations_seed.empty()) { \
11+
local_state_->SetString(variations::prefs::kVariationsCountry, \
12+
base::ToLowerASCII(brave_l10n::GetDefaultISOCountryCodeString())); \
13+
}
14+
15+
#include "src/chrome/browser/metrics/chrome_feature_list_creator.cc"
16+
17+
#undef BRAVE_CHROME_FEATURE_LIST_CREATOR_SETUP_INITIAL_PREFS
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/chrome/browser/metrics/chrome_feature_list_creator.cc b/chrome/browser/metrics/chrome_feature_list_creator.cc
2+
index 73c9ee5a0d93a3937a95c3fb0da6992ef0cea567..809863891726b1ed22dedee8a92968bf5f0594d4 100644
3+
--- a/chrome/browser/metrics/chrome_feature_list_creator.cc
4+
+++ b/chrome/browser/metrics/chrome_feature_list_creator.cc
5+
@@ -351,5 +351,7 @@ void ChromeFeatureListCreator::SetupInitialPrefs() {
6+
local_state_->SetInt64(variations::prefs::kVariationsSeedDate,
7+
base::Time::Now().ToInternalValue());
8+
}
9+
+
10+
+ BRAVE_CHROME_FEATURE_LIST_CREATOR_SETUP_INITIAL_PREFS
11+
#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
12+
}

0 commit comments

Comments
 (0)