Skip to content

Commit

Permalink
Merge pull request #3718 from brave/fix_vmp_not_working
Browse files Browse the repository at this point in the history
Update wrong GOOGLE_CHROME_BUILD usage
  • Loading branch information
bsclifton committed Oct 22, 2019
2 parents 8299597 + f041122 commit f3b4aab
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions browser/extensions/updater/brave_update_client_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand Down
6 changes: 3 additions & 3 deletions chromium_src/chrome/common/media/cdm_host_file_path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 13 additions & 8 deletions chromium_src/components/metrics/metrics_service_accessor.cc
Original file line number Diff line number Diff line change
@@ -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"
17 changes: 4 additions & 13 deletions patches/chrome-installer-util-google_update_settings.cc.patch
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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

0 comments on commit f3b4aab

Please sign in to comment.