Skip to content

Commit

Permalink
Use overriding technique to updater_state_win.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhong committed Jun 20, 2018
1 parent 279486e commit b23256e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 17 deletions.
25 changes: 25 additions & 0 deletions chromium_src/components/update_client/updater_state_win.cc
Original file line number Diff line number Diff line change
@@ -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";

This comment has been minimized.

Copy link
@bridiver

bridiver Jun 20, 2018

Collaborator

we only want values here that we are overriding

This comment has been minimized.

Copy link
@simonhong

simonhong Jun 20, 2018

Author Member

I'll remove it.

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"
23 changes: 6 additions & 17 deletions patches/components-update_client-updater_state_win.cc.patch
Original file line number Diff line number Diff line change
@@ -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}";
Expand Down

0 comments on commit b23256e

Please sign in to comment.