From 0a74ea09c0823ce196728ef21ef964e391fe136e Mon Sep 17 00:00:00 2001 From: brave-builds Date: Tue, 22 Oct 2019 00:04:47 +0000 Subject: [PATCH] Uplift of #3718 (squashed) to dev --- .../brave_component_updater_configurator.cc | 4 ---- .../updater/brave_update_client_config.cc | 4 ---- .../chrome/common/media/cdm_host_file_path.cc | 6 +++--- .../metrics/metrics_service_accessor.cc | 21 ++++++++++++------- ...aller-util-google_update_settings.cc.patch | 17 ++++----------- 5 files changed, 20 insertions(+), 32 deletions(-) diff --git a/browser/component_updater/brave_component_updater_configurator.cc b/browser/component_updater/brave_component_updater_configurator.cc index c5ad96586064..529343445492 100644 --- a/browser/component_updater/brave_component_updater_configurator.cc +++ b/browser/component_updater/brave_component_updater_configurator.cc @@ -185,11 +185,7 @@ BraveConfigurator::GetProtocolHandlerFactory() const { update_client::RecoveryCRXElevator BraveConfigurator::GetRecoveryCRXElevator() const { -#if defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) - return base::BindOnce(&RunRecoveryCRXElevated); -#else return {}; -#endif } } // namespace component_updater diff --git a/browser/extensions/updater/brave_update_client_config.cc b/browser/extensions/updater/brave_update_client_config.cc index 022a8104b552..3453be2edc85 100644 --- a/browser/extensions/updater/brave_update_client_config.cc +++ b/browser/extensions/updater/brave_update_client_config.cc @@ -243,11 +243,7 @@ BraveUpdateClientConfig::GetProtocolHandlerFactory() const { update_client::RecoveryCRXElevator BraveUpdateClientConfig::GetRecoveryCRXElevator() const { -#if defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) - return base::BindOnce(&RunRecoveryCRXElevated); -#else return {}; -#endif } BraveUpdateClientConfig::~BraveUpdateClientConfig() {} diff --git a/chromium_src/chrome/common/media/cdm_host_file_path.cc b/chromium_src/chrome/common/media/cdm_host_file_path.cc index 6375a75475d8..ef475220df87 100644 --- a/chromium_src/chrome/common/media/cdm_host_file_path.cc +++ b/chromium_src/chrome/common/media/cdm_host_file_path.cc @@ -10,18 +10,18 @@ #include "base/logging.h" #include "base/path_service.h" #include "base/stl_util.h" +#include "build/branding_buildflags.h" #include "build/build_config.h" #include "chrome/common/chrome_version.h" #if defined(OS_MACOSX) #include "base/mac/bundle_locations.h" -#include "chrome/common/buildflags.h" #include "chrome/common/chrome_constants.h" #endif // All above headers copied from original cdm_host_file_path.cc are included // to prevent below GOOGLE_CHROEM_BUILD affect them. -#define GOOGLE_CHROME_BUILD +#undef BUILDFLAG_INTERNAL_GOOGLE_CHROME_BRANDING +#define BUILDFLAG_INTERNAL_GOOGLE_CHROME_BRANDING() (1) #include "../../../../../chrome/common/media/cdm_host_file_path.cc" // NOLINT -#undef GOOGLE_CHROME_BUILD diff --git a/chromium_src/components/metrics/metrics_service_accessor.cc b/chromium_src/components/metrics/metrics_service_accessor.cc index 3404634e5960..c2b9115f545d 100644 --- a/chromium_src/components/metrics/metrics_service_accessor.cc +++ b/chromium_src/components/metrics/metrics_service_accessor.cc @@ -1,13 +1,18 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* Copyright (c) 2019 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/. */ -#if defined(BRAVE_CHROMIUM_BUILD) -#define GOOGLE_CHROME_BUILD -#endif +#include "components/metrics/metrics_service_accessor.h" -#include "../../../../components/metrics/metrics_service_accessor.cc" +#include "base/base_switches.h" +#include "base/command_line.h" +#include "build/branding_buildflags.h" +#include "components/metrics/metrics_pref_names.h" +#include "components/metrics/metrics_service.h" +#include "components/prefs/pref_service.h" +#include "components/variations/hashing.h" -#if defined(BRAVE_CHROMIUM_BUILD) -#undef GOOGLE_CHROME_BUILD -#endif +#undef BUILDFLAG_INTERNAL_GOOGLE_CHROME_BRANDING +#define BUILDFLAG_INTERNAL_GOOGLE_CHROME_BRANDING() (1) +#include "../../../../components/metrics/metrics_service_accessor.cc" diff --git a/patches/chrome-installer-util-google_update_settings.cc.patch b/patches/chrome-installer-util-google_update_settings.cc.patch index 377789372114..0e5383c246f8 100644 --- a/patches/chrome-installer-util-google_update_settings.cc.patch +++ b/patches/chrome-installer-util-google_update_settings.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc -index 441ed6d50d5cb4edcd665665fca7887f034ff6a0..709c7e5e24518902ae86ab1ef819dd9d86239d1a 100644 +index 441ed6d50d5cb4edcd665665fca7887f034ff6a0..54a22d11c380ee31e12440900cf2a365781fe8d9 100644 --- a/chrome/installer/util/google_update_settings.cc +++ b/chrome/installer/util/google_update_settings.cc @@ -29,7 +29,11 @@ using base::win::RegKey; @@ -14,23 +14,14 @@ index 441ed6d50d5cb4edcd665665fca7887f034ff6a0..709c7e5e24518902ae86ab1ef819dd9d const wchar_t GoogleUpdateSettings::kUpdatePolicyValue[] = L"UpdateDefault"; const wchar_t GoogleUpdateSettings::kDownloadPreferencePolicyValue[] = L"DownloadPreference"; -@@ -41,6 +45,11 @@ const wchar_t GoogleUpdateSettings::kCheckPeriodOverrideMinutes[] = +@@ -41,6 +45,10 @@ const wchar_t GoogleUpdateSettings::kCheckPeriodOverrideMinutes[] = const int GoogleUpdateSettings::kCheckPeriodOverrideMinutesMax = 60 * 24 * 7 * 6; -+ +#if defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD) -+#define GOOGLE_CHROME_BUILD ++#undef BUILDFLAG_INTERNAL_GOOGLE_CHROME_BRANDING ++#define BUILDFLAG_INTERNAL_GOOGLE_CHROME_BRANDING() (1) +#endif -+ const GoogleUpdateSettings::UpdatePolicy GoogleUpdateSettings::kDefaultUpdatePolicy = #if BUILDFLAG(GOOGLE_CHROME_BRANDING) -@@ -836,3 +845,7 @@ bool GoogleUpdateSettings::ReadExperimentLabels( - - return result == ERROR_SUCCESS; - } -+ -+#if defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD) -+#undef GOOGLE_CHROME_BUILD -+#endif