From b23256e3148924eb8ac3086aa97617fd3e4e47a8 Mon Sep 17 00:00:00 2001 From: Simon Hong Date: Wed, 20 Jun 2018 13:05:42 +0900 Subject: [PATCH] Use overriding technique to updater_state_win.cc --- .../update_client/updater_state_win.cc | 25 +++++++++++++++++++ ...s-update_client-updater_state_win.cc.patch | 23 +++++------------ 2 files changed, 31 insertions(+), 17 deletions(-) create mode 100644 chromium_src/components/update_client/updater_state_win.cc diff --git a/chromium_src/components/update_client/updater_state_win.cc b/chromium_src/components/update_client/updater_state_win.cc new file mode 100644 index 000000000000..af9b1926e246 --- /dev/null +++ b/chromium_src/components/update_client/updater_state_win.cc @@ -0,0 +1,25 @@ +/* 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/. */ + +namespace update_client { + +namespace { + +const int kCheckPeriodOverrideMinutesMax = 60 * 24 * 7 * 6; +const wchar_t kGoogleUpdatePoliciesKey[] = + L"SOFTWARE\\Policies\\BraveSoftware\\Update"; +const wchar_t kCheckPeriodOverrideMinutes[] = L"AutoUpdateCheckPeriodMinutes"; +const wchar_t kUpdatePolicyValue[] = L"UpdateDefault"; +const wchar_t kChromeUpdatePolicyOverride[] = + L"Update{AFE6A462-C574-4B8A-AF43-4CC60DF4563B}"; +const wchar_t kRegPathGoogleUpdate[] = L"Software\\BraveSoftware\\Update"; +const wchar_t kRegPathClientsGoogleUpdate[] = + L"Software\\BraveSoftware\\Update\\Clients\\" + L"{B131C935-9BE6-41DA-9599-1F776BEB8019}"; + +} // namespace + +} // namespace update_client + +#include "../../../../components/update_client/updater_state_win.cc" diff --git a/patches/components-update_client-updater_state_win.cc.patch b/patches/components-update_client-updater_state_win.cc.patch index 508de0259573..6fc3a4b3d433 100644 --- a/patches/components-update_client-updater_state_win.cc.patch +++ b/patches/components-update_client-updater_state_win.cc.patch @@ -1,28 +1,17 @@ diff --git a/components/update_client/updater_state_win.cc b/components/update_client/updater_state_win.cc -index 66a049048b4b99b3296af25f0ffc914cf0ed8f2c..a0fa4805e3c63087f002f9c2db4ad0943f3c9d3d 100644 +index 66a049048b4b99b3296af25f0ffc914cf0ed8f2c..d17036d74eafb214eacfaa4a5e7b43d048c869a9 100644 --- a/components/update_client/updater_state_win.cc +++ b/components/update_client/updater_state_win.cc -@@ -23,6 +23,19 @@ namespace update_client { +@@ -22,7 +22,7 @@ + namespace update_client { namespace { - -+#if defined(BRAVE_CHROMIUM_BUILD) -+const wchar_t kGoogleUpdatePoliciesKey[] = -+ L"SOFTWARE\\Policies\\BraveSoftware\\Update"; -+const wchar_t kCheckPeriodOverrideMinutes[] = L"AutoUpdateCheckPeriodMinutes"; -+const wchar_t kUpdatePolicyValue[] = L"UpdateDefault"; -+const wchar_t kChromeUpdatePolicyOverride[] = -+ L"Update{AFE6A462-C574-4B8A-AF43-4CC60DF4563B}"; -+const int kCheckPeriodOverrideMinutesMax = 60 * 24 * 7 * 6; -+const wchar_t kRegPathGoogleUpdate[] = L"Software\\BraveSoftware\\Update"; -+const wchar_t kRegPathClientsGoogleUpdate[] = -+ L"Software\\BraveSoftware\\Update\\Clients\\" -+ L"{B131C935-9BE6-41DA-9599-1F776BEB8019}"; -+#else +- ++#if !defined(BRAVE_CHROMIUM_BUILD) // Google Update group policy settings. const wchar_t kGoogleUpdatePoliciesKey[] = L"SOFTWARE\\Policies\\Google\\Update"; -@@ -39,6 +52,7 @@ const wchar_t kRegPathGoogleUpdate[] = L"Software\\Google\\Update"; +@@ -39,6 +39,7 @@ const wchar_t kRegPathGoogleUpdate[] = L"Software\\Google\\Update"; const wchar_t kRegPathClientsGoogleUpdate[] = L"Software\\Google\\Update\\Clients\\" L"{430FD4D0-B729-4F61-AA34-91526481799D}";