From 1ee4f66f80d0787996ac5ec587810340aeb40b7c Mon Sep 17 00:00:00 2001 From: Olivier Robin Date: Mon, 20 Jan 2020 13:42:31 +0000 Subject: [PATCH] Use USE_OFFICIAL_GOOGLE_API_KEYS on Google branding builds. On google branding builds, the official keys are used. Make sure that the logic is the same in BUILD.gn files. Bug: 1043599 Change-Id: I4b603c467418094b5ff6ce1e7c573d7c89423a47 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2007467 Reviewed-by: Mihai Sardarescu Reviewed-by: Sylvain Defresne Commit-Queue: Olivier Robin Cr-Commit-Position: refs/heads/master@{#733338} --- google_apis/BUILD.gn | 5 +++-- google_apis/google_api_keys.cc | 4 ++-- google_apis/google_api_keys_unittest.cc | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/google_apis/BUILD.gn b/google_apis/BUILD.gn index 82d8a5c65416f1..520be6c4bf2c0e 100644 --- a/google_apis/BUILD.gn +++ b/google_apis/BUILD.gn @@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/chrome_build.gni") import("//build/config/features.gni") import("//extensions/buildflags/buildflags.gni") import("//testing/test.gni") @@ -64,7 +65,7 @@ if (use_official_google_api_keys == "") { config("key_defines") { defines = [] - if (use_official_google_api_keys) { + if (is_chrome_branded || use_official_google_api_keys) { defines += [ "USE_OFFICIAL_GOOGLE_API_KEYS=1" ] } if (google_api_key != "") { @@ -140,7 +141,7 @@ template("google_apis_tmpl") { "//services/network/public/cpp", ] - if (use_official_google_api_keys) { + if (is_chrome_branded || use_official_google_api_keys) { deps += [ "internal:generate_metrics_key_header" ] } diff --git a/google_apis/google_api_keys.cc b/google_apis/google_api_keys.cc index d01ef89f6a8681..ff46314dd4ce73 100644 --- a/google_apis/google_api_keys.cc +++ b/google_apis/google_api_keys.cc @@ -23,7 +23,7 @@ #include "google_apis/google_api_keys_mac.h" #endif -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(USE_OFFICIAL_GOOGLE_API_KEYS) +#if defined(USE_OFFICIAL_GOOGLE_API_KEYS) #include "google_apis/internal/google_chrome_api_keys.h" #include "google_apis/internal/metrics_signing_key.h" #endif @@ -363,7 +363,7 @@ std::string GetSpdyProxyAuthValue() { } bool IsGoogleChromeAPIKeyUsed() { -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(USE_OFFICIAL_GOOGLE_API_KEYS) +#if defined(USE_OFFICIAL_GOOGLE_API_KEYS) return true; #else return false; diff --git a/google_apis/google_api_keys_unittest.cc b/google_apis/google_api_keys_unittest.cc index 669be144d6dfb6..d92b237cf82672 100644 --- a/google_apis/google_api_keys_unittest.cc +++ b/google_apis/google_api_keys_unittest.cc @@ -89,7 +89,7 @@ void GoogleAPIKeysTest::TearDown() { // This is the default baked-in value for OAuth IDs and secrets. static const char kDummyToken[] = "dummytoken"; -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(USE_OFFICIAL_GOOGLE_API_KEYS) +#if defined(USE_OFFICIAL_GOOGLE_API_KEYS) // Test official build behavior, since we are in a checkout where this // is possible. namespace official_build {