Skip to content

Added Manrope reference for Poppins font #12932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
15 changes: 15 additions & 0 deletions browser/brave_stats/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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 http://mozilla.org/MPL/2.0/. */

import("//build/buildflag_header.gni")

declare_args() {
brave_stats_updater_url = ""
}

buildflag_header("buildflags") {
header = "buildflags.h"
flags = [ "BRAVE_USAGE_SERVER=\"$brave_stats_updater_url\"" ]
}
3 changes: 2 additions & 1 deletion browser/brave_stats/brave_stats_updater.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "base/system/sys_info.h"
#include "bat/ads/pref_names.h"
#include "brave/browser/brave_stats/brave_stats_updater_params.h"
#include "brave/browser/brave_stats/buildflags.h"
#include "brave/browser/brave_stats/switches.h"
#include "brave/common/brave_channel_info.h"
#include "brave/common/network_constants.h"
Expand Down Expand Up @@ -105,7 +106,7 @@ BraveStatsUpdater::BraveStatsUpdater(PrefService* pref_service)
if (!GURL(usage_server_).is_valid())
LOG(ERROR) << "bad url given as stats updater url: " << usage_server_;
} else {
usage_server_ = BRAVE_USAGE_SERVER;
usage_server_ = BUILDFLAG(BRAVE_USAGE_SERVER);
}

// Track initial profile creation
Expand Down
8 changes: 1 addition & 7 deletions browser/brave_stats/sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@

import("//brave/components/brave_referrals/buildflags/buildflags.gni")

declare_args() {
brave_stats_updater_url = ""
}

if (is_official_build) {
assert(brave_stats_updater_url != "")
}

brave_browser_brave_stats_updater_defines =
[ "BRAVE_USAGE_SERVER=\"$brave_stats_updater_url\"" ]

brave_browser_brave_stats_updater_sources = [
"//brave/browser/brave_stats/brave_stats_tab_helper.cc",
"//brave/browser/brave_stats/brave_stats_tab_helper.h",
Expand All @@ -28,6 +21,7 @@ brave_browser_brave_stats_updater_sources = [

brave_browser_brave_stats_updater_deps = [
"//base",
"//brave/browser/brave_stats:buildflags",
"//brave/browser:browser_process",
"//brave/common",
"//brave/common:network_constants",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include "base/strings/string_piece_forward.h"
#include "brave/browser/net/brave_geolocation_buildflags.h"
#include "brave/browser/safebrowsing/buildflags.h"
#include "brave/common/network_constants.h"
#include "extensions/common/url_pattern.h"
#include "net/base/net_errors.h"
Expand All @@ -27,7 +28,7 @@ bool g_safebrowsing_api_endpoint_for_testing_ = false;
base::StringPiece GetSafeBrowsingEndpoint() {
if (g_safebrowsing_api_endpoint_for_testing_)
return kSafeBrowsingTestingEndpoint;
return SAFEBROWSING_ENDPOINT;
return BUILDFLAG(SAFEBROWSING_ENDPOINT);
}

} // namespace
Expand Down
10 changes: 5 additions & 5 deletions browser/safebrowsing/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import("//build/buildflag_header.gni")
import("//build/config/features.gni")

declare_args() {
safebrowsing_api_endpoint = ""
}

config("safebrowsing_config") {
defines = [
"SAFEBROWSING_ENDPOINT=\"$safebrowsing_api_endpoint\""
]
buildflag_header("buildflags") {
header = "buildflags.h"
flags = [ "SAFEBROWSING_ENDPOINT=\"$safebrowsing_api_endpoint\"" ]
}

source_set("safebrowsing") {
public_configs = [ ":safebrowsing_config" ]
public_deps = [ ":buildflags" ]
}
2 changes: 0 additions & 2 deletions browser/sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -445,5 +445,3 @@ brave_chrome_browser_deps += brave_browser_themes_deps
brave_chrome_browser_deps += brave_browser_web_discovery_deps
brave_chrome_browser_deps += brave_chromium_src_chrome_browser_deps
brave_chrome_browser_deps += brave_chromium_src_chrome_browser_prefs_deps

brave_chrome_browser_defines += brave_browser_brave_stats_updater_defines
2 changes: 2 additions & 0 deletions chromium_src/chrome/app/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ include_rules = [
specific_include_rules = {
"chrome_main_delegate.cc": [
"+brave/build/android/jni_headers/BraveQAPreferences_jni.h",
"+brave/components/brave_sync/buildflags.h",
"+brave/components/variations/buildflags.h",
"+components/signin/public/base/account_consistency_method.h",
"+components/sync/base/command_line_switches.h",
],
Expand Down
10 changes: 7 additions & 3 deletions chromium_src/chrome/app/chrome_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// chrome/BUILD.gn
#include "brave/app/brave_command_line_helper.cc"
#include "brave/app/brave_main_delegate.cc"
#include "brave/components/brave_sync/buildflags.h"
#include "brave/components/variations/buildflags.h"
#include "build/build_config.h"
#include "components/sync/base/command_line_switches.h"

Expand Down Expand Up @@ -75,7 +77,7 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exit_code) {
kBraveOriginTrialsPublicKey);
}

std::string brave_sync_service_url = BRAVE_SYNC_ENDPOINT;
std::string brave_sync_service_url = BUILDFLAG(BRAVE_SYNC_ENDPOINT);
#if BUILDFLAG(IS_ANDROID)
AdjustSyncServiceUrlForAndroid(&brave_sync_service_url);
#endif // BUILDFLAG(IS_ANDROID)
Expand All @@ -87,14 +89,16 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exit_code) {
command_line.AppendSwitchASCII(switches::kLsoUrl, kDummyUrl);

// Brave variations
const std::string kVariationsServerURL = BRAVE_VARIATIONS_SERVER_URL;
const std::string kVariationsServerURL =
BUILDFLAG(BRAVE_VARIATIONS_SERVER_URL);
command_line.AppendSwitchASCII(variations::switches::kVariationsServerURL,
kVariationsServerURL.c_str());
// 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.
const std::string kVariationsInsecureServerURL = BRAVE_VARIATIONS_SERVER_URL;
const std::string kVariationsInsecureServerURL =
BUILDFLAG(BRAVE_VARIATIONS_SERVER_URL);
command_line.AppendSwitchASCII(
variations::switches::kVariationsInsecureServerURL,
kVariationsInsecureServerURL.c_str());
Expand Down
12 changes: 7 additions & 5 deletions components/binance/browser/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import("//brave/build/config.gni")
import("//brave/components/binance/browser/buildflags/buildflags.gni")
import("//build/buildflag_header.gni")

assert(binance_enabled)

declare_args() {
binance_client_id = ""
}

buildflag_header("buildflags") {
header = "buildflags.h"
flags = [ "BINANCE_CLIENT_ID=\"$binance_client_id\"" ]
}

static_library("browser") {
public_deps = [ "buildflags" ]
sources = [
Expand All @@ -18,6 +24,7 @@ static_library("browser") {
]

deps = [
":buildflags",
"//base",
"//brave/common:pref_names",
"//brave/components/ntp_widget_utils/browser",
Expand All @@ -32,9 +39,4 @@ static_library("browser") {
"//services/network/public/cpp",
"//url",
]
configs += [ ":binance_config" ]
}

config("binance_config") {
defines = [ "BINANCE_CLIENT_ID=\"$binance_client_id\"" ]
}
3 changes: 2 additions & 1 deletion components/binance/browser/binance_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "base/token.h"
#include "brave/common/pref_names.h"
#include "brave/components/binance/browser/binance_json_parser.h"
#include "brave/components/binance/browser/buildflags.h"
#include "brave/components/binance/browser/regions.h"
#include "brave/components/ntp_widget_utils/browser/ntp_widget_utils_oauth.h"
#include "brave/components/ntp_widget_utils/browser/ntp_widget_utils_region.h"
Expand Down Expand Up @@ -79,7 +80,7 @@ GURL GetURLWithPath(const std::string& host, const std::string& path) {
} // namespace

BinanceService::BinanceService(content::BrowserContext* context)
: client_id_(BINANCE_CLIENT_ID),
: client_id_(BUILDFLAG(BINANCE_CLIENT_ID)),
oauth_host_(oauth_host),
gateway_host_(gateway_host),
context_(context),
Expand Down
7 changes: 4 additions & 3 deletions components/brave_adaptive_captcha/server_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@
#include "base/command_line.h"
#include "base/notreached.h"
#include "brave/components/brave_ads/common/switches.h"
#include "brave/vendor/bat-native-ledger/buildflags.h"

namespace brave_adaptive_captcha {

std::string GetServerUrl(const std::string& path) {
DCHECK(!path.empty());

std::string url = REWARDS_GRANT_PROD_ENDPOINT;
std::string url = BUILDFLAG(REWARDS_GRANT_PROD_ENDPOINT);

auto* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(brave_ads::switches::kStaging)) {
url = REWARDS_GRANT_STAGING_ENDPOINT;
url = BUILDFLAG(REWARDS_GRANT_STAGING_ENDPOINT);
} else if (command_line->HasSwitch(brave_ads::switches::kProduction)) {
url = REWARDS_GRANT_PROD_ENDPOINT;
url = BUILDFLAG(REWARDS_GRANT_PROD_ENDPOINT);
}

return url + path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "base/strings/string_util.h"
#include "base/task/post_task.h"
#include "brave/components/brave_rewards/common/url_constants.h"
#include "brave/vendor/bat-native-ledger/buildflags.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/escape.h"
Expand Down Expand Up @@ -59,8 +60,8 @@ void LoadRewardsURL(
}

// Only accept rewards scheme from allowed domains
GURL bitflyer_staging_url = GURL(BITFLYER_STAGING_URL);
GURL gemini_oauth_staging_url = GURL(GEMINI_OAUTH_STAGING_URL);
GURL bitflyer_staging_url = GURL(BUILDFLAG(BITFLYER_STAGING_URL));
GURL gemini_oauth_staging_url = GURL(BUILDFLAG(GEMINI_OAUTH_STAGING_URL));

DCHECK(bitflyer_staging_url.is_valid() && bitflyer_staging_url.has_host());
DCHECK(gemini_oauth_staging_url.is_valid() &&
Expand Down
10 changes: 8 additions & 2 deletions components/brave_stats/browser/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import("//build/buildflag_header.gni")

declare_args() {
brave_stats_api_key = ""
}

static_library("browser") {
defines = [ "BRAVE_STATS_API_KEY=\"$brave_stats_api_key\"" ]
buildflag_header("buildflags") {
header = "buildflags.h"
flags = [ "BRAVE_STATS_API_KEY=\"$brave_stats_api_key\"" ]
}

static_library("browser") {
sources = [
"brave_stats_updater_util.cc",
"brave_stats_updater_util.h",
]

deps = [
":buildflags",
"//base",
"//components/prefs",
]
Expand Down
3 changes: 2 additions & 1 deletion components/brave_stats/browser/brave_stats_updater_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
#include "brave/components/brave_stats/browser/buildflags.h"
#include "build/build_config.h"

namespace brave_stats {
Expand Down Expand Up @@ -81,7 +82,7 @@ base::Time GetYMDAsDate(const base::StringPiece& ymd) {
}

std::string GetAPIKey() {
std::string api_key = BRAVE_STATS_API_KEY;
std::string api_key = BUILDFLAG(BRAVE_STATS_API_KEY);
std::unique_ptr<base::Environment> env(base::Environment::Create());
if (env->HasVar("BRAVE_STATS_API_KEY"))
env->GetVar("BRAVE_STATS_API_KEY", &api_key);
Expand Down
8 changes: 5 additions & 3 deletions components/brave_sync/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import("//brave/components/common/typescript.gni")
import("//build/buildflag_header.gni")
import("//build/config/features.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/grit/repack.gni")
Expand All @@ -11,8 +12,9 @@ if (is_official_build) {
assert(brave_sync_endpoint != "")
}

config("brave_sync_config") {
defines = [ "BRAVE_SYNC_ENDPOINT=\"$brave_sync_endpoint\"" ]
buildflag_header("buildflags") {
header = "buildflags.h"
flags = [ "BRAVE_SYNC_ENDPOINT=\"$brave_sync_endpoint\"" ]
}

static_library("crypto") {
Expand Down Expand Up @@ -109,7 +111,7 @@ group("brave_sync") {
}

group("constants") {
public_configs = [ ":brave_sync_config" ]
public_deps = [ ":buildflags" ]
}

source_set("unit_tests") {
Expand Down
15 changes: 0 additions & 15 deletions components/ftx/browser/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import("//brave/build/config.gni")
import("//brave/components/ftx/browser/buildflags/buildflags.gni")

assert(enable_ftx)

declare_args() {
ftx_client_id = ""
ftx_client_secret = ""
}

static_library("browser") {
public_deps = [ "buildflags" ]
sources = [
Expand Down Expand Up @@ -36,13 +30,4 @@ static_library("browser") {
"//services/network/public/cpp",
"//url",
]

configs += [ ":ftx_config" ]
}

config("ftx_config") {
defines = [
"FTX_CLIENT_ID=\"$ftx_client_id\"",
"FTX_CLIENT_SECRET=\"$ftx_client_secret\"",
]
}
4 changes: 3 additions & 1 deletion components/ftx/browser/buildflags/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import("//build/buildflag_header.gni")
import("//brave/components/ftx/browser/buildflags/buildflags.gni")
import("//build/buildflag_header.gni")

buildflag_header("buildflags") {
header = "buildflags.h"
flags = [
"ENABLE_FTX=$enable_ftx",
"FTX_CLIENT_ID=\"$ftx_client_id\"",
"FTX_CLIENT_SECRET=\"$ftx_client_secret\"",
]
}
4 changes: 2 additions & 2 deletions components/ftx/browser/buildflags/buildflags.gni
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import("//build/config/features.gni")

declare_args() {
enable_ftx = is_mac || is_linux || is_win
ftx_client_id = ""
ftx_client_secret = ""
}
5 changes: 3 additions & 2 deletions components/ftx/browser/ftx_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "base/task/post_task.h"
#include "base/task/task_runner_util.h"
#include "base/task/thread_pool.h"
#include "brave/components/ftx/browser/buildflags/buildflags.h"
#include "brave/components/ftx/browser/ftx_json_parser.h"
#include "brave/components/ftx/common/pref_names.h"
#include "brave/components/ntp_widget_utils/browser/ntp_widget_utils_oauth.h"
Expand Down Expand Up @@ -75,8 +76,8 @@ void BuildFormEncoding(const std::string& key,
} // namespace

FTXService::FTXService(content::BrowserContext* context)
: client_id_(FTX_CLIENT_ID),
client_secret_(FTX_CLIENT_SECRET),
: client_id_(BUILDFLAG(FTX_CLIENT_ID)),
client_secret_(BUILDFLAG(FTX_CLIENT_SECRET)),
context_(context),
url_loader_factory_(context_->GetDefaultStoragePartition()
->GetURLLoaderFactoryForBrowserProcess()),
Expand Down
Loading