0

[google_apis] Allow overriding use_official_google_api_keys

Previously, is_chrome_branded would override a false value. Fix that and
update the C++ logic to be compatible. Retains the existing behavior
for iOS only due to iOS issue https://crbug.com/1171510, which caused
the previous attempt, https://crrev.com/c/2657805, to be reverted.

Bug: 1294915, 1183709
Change-Id: I68d8babe6461a91117396488b2a27772c9952f80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3756721
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: David Dorwin <ddorwin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1041234}
This commit is contained in:
David Dorwin
2022-08-30 23:06:24 +00:00
committed by Chromium LUCI CQ
parent 6a96ad6216
commit 0ae6b65b32
3 changed files with 52 additions and 26 deletions

@ -89,7 +89,8 @@ std::string GetReadAloudAPIKey();
// Retrieves the Fresnel API Key.
std::string GetFresnelAPIKey();
#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_FUCHSIA)
#if BUILDFLAG(IS_IOS) || \
(BUILDFLAG(IS_FUCHSIA) && !defined(USE_OFFICIAL_GOOGLE_API_KEYS))
// Sets the API key. This should be called as early as possible before this
// API key is even accessed. It must be called before GetAPIKey.
// TODO(https://crbug.com/1166007): Enforce this is called before GetAPIKey.