diff --git a/chromium_src/chrome/install_static/install_modes.cc b/chromium_src/chrome/install_static/install_modes.cc index 04e105e2a22..7232ef32c60 100644 --- a/chromium_src/chrome/install_static/install_modes.cc +++ b/chromium_src/chrome/install_static/install_modes.cc @@ -5,67 +5,44 @@ #include "chrome/install_static/install_modes.h" +#include "chrome/install_static/buildflags.h" + +namespace install_static { + namespace { -#if defined(OFFICIAL_BUILD) -std::wstring GetClientsKeyPathForApp(const wchar_t* app_guid) { - return std::wstring(L"Software\\BraveSoftware\\Update\\Clients\\") - .append(app_guid); -} - -std::wstring GetClientStateKeyPathForApp(const wchar_t* app_guid) { - return std::wstring(L"Software\\BraveSoftware\\Update\\ClientState\\") - .append(app_guid); -} - -std::wstring GetClientStateMediumKeyPathForApp(const wchar_t* app_guid) { - return std::wstring(L"Software\\BraveSoftware\\Update\\ClientStateMedium\\") - .append(app_guid); +#if !defined(OFFICIAL_BUILD) +std::wstring GetUnregisteredKeyPathForProduct() { + return std::wstring(L"Software\\").append(kProductPathName); } #endif } // namespace -#define GetClientsKeyPathForApp GetClientsKeyPathForApp_Unused -#define GetClientStateKeyPathForApp GetClientStateKeyPathForApp_Unused -#define GetClientStateMediumKeyPathForApp \ - GetClientStateMediumKeyPathForApp_Unused -#define GetClientsKeyPath GetClientsKeyPath_ChromiumImpl -#define GetClientStateKeyPath GetClientStateKeyPath_ChromiumImpl -#define GetClientStateMediumKeyPath GetClientStateMediumKeyPath_ChromiumImpl - -#include "../../../../chrome/install_static/install_modes.cc" - -#undef GetClientsKeyPath -#undef GetClientStateKeyPath -#undef GetClientStateMediumKeyPath -#undef GetClientsKeyPathForApp -#undef GetClientStateKeyPathForApp -#undef GetClientStateMediumKeyPathForApp - -namespace install_static { - std::wstring GetClientsKeyPath(const wchar_t* app_guid) { #if defined(OFFICIAL_BUILD) - return GetClientsKeyPathForApp(app_guid); + return std::wstring(L"Software\\BraveSoftware\\Update\\Clients\\") + .append(app_guid); #else - return GetClientsKeyPath_ChromiumImpl(app_guid); + return GetUnregisteredKeyPathForProduct(); #endif } std::wstring GetClientStateKeyPath(const wchar_t* app_guid) { #if defined(OFFICIAL_BUILD) - return GetClientStateKeyPathForApp(app_guid); + return std::wstring(L"Software\\BraveSoftware\\Update\\ClientState\\") + .append(app_guid); #else - return GetClientStateKeyPath_ChromiumImpl(app_guid); + return GetUnregisteredKeyPathForProduct(); #endif } std::wstring GetClientStateMediumKeyPath(const wchar_t* app_guid) { #if defined(OFFICIAL_BUILD) - return GetClientStateMediumKeyPathForApp(app_guid); + return std::wstring(L"Software\\BraveSoftware\\Update\\ClientStateMedium\\") + .append(app_guid); #else - return GetClientStateMediumKeyPath_ChromiumImpl(app_guid); + return GetUnregisteredKeyPathForProduct(); #endif } diff --git a/chromium_src/chrome/install_static/install_modes.h b/chromium_src/chrome/install_static/install_modes.h deleted file mode 100644 index 3d5c60c1590..00000000000 --- a/chromium_src/chrome/install_static/install_modes.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright 2021 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/. */ - -#ifndef BRAVE_CHROMIUM_SRC_CHROME_INSTALL_STATIC_INSTALL_MODES_H_ -#define BRAVE_CHROMIUM_SRC_CHROME_INSTALL_STATIC_INSTALL_MODES_H_ - -#include - -#define GetClientsKeyPath \ - GetClientsKeyPath_ChromiumImpl(const wchar_t* app_guid); \ - std::wstring GetClientsKeyPath - -#define GetClientStateKeyPath \ - GetClientStateKeyPath_ChromiumImpl(const wchar_t* app_guid); \ - std::wstring GetClientStateKeyPath - -#define GetClientStateMediumKeyPath \ - GetClientStateMediumKeyPath_ChromiumImpl(const wchar_t* app_guid); \ - std::wstring GetClientStateMediumKeyPath - -#include "../../../../chrome/install_static/install_modes.h" - -#undef GetClientsKeyPath -#undef GetClientStateKeyPath -#undef GetClientStateMediumKeyPath - -#endif // BRAVE_CHROMIUM_SRC_CHROME_INSTALL_STATIC_INSTALL_MODES_H_