Skip to content

Commit

Permalink
Use USE_OFFICIAL_GOOGLE_API_KEYS on Google branding builds.
Browse files Browse the repository at this point in the history
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 <msarda@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733338}
  • Loading branch information
Olivier Robin authored and Commit Bot committed Jan 20, 2020
1 parent 036729c commit 1ee4f66
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions google_apis/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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 != "") {
Expand Down Expand Up @@ -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" ]
}

Expand Down
4 changes: 2 additions & 2 deletions google_apis/google_api_keys.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion google_apis/google_api_keys_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1ee4f66

Please sign in to comment.