Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5975)

Unified Diff: chrome/install_static/install_modes.cc

Issue 2422643002: Windows install_static refactor. (Closed)
Patch Set: sync to position 431863 Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/install_static/install_modes.cc
diff --git a/chrome/install_static/install_modes.cc b/chrome/install_static/install_modes.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2061224e69954e1bddfa9ccb0571c62c1445e22c
--- /dev/null
+++ b/chrome/install_static/install_modes.cc
@@ -0,0 +1,51 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/install_static/install_modes.h"
+
+namespace install_static {
+
+namespace {
+
+std::wstring GetUnregisteredKeyPathForProduct(const wchar_t* product) {
+ return std::wstring(L"Software\\").append(product);
+}
+
+std::wstring GetClientStateKeyPathForApp(const wchar_t* app_guid) {
+ return std::wstring(L"Software\\Google\\Update\\ClientState\\")
+ .append(app_guid);
+}
+
+std::wstring GetClientStateMediumKeyPathForApp(const wchar_t* app_guid) {
+ return std::wstring(L"Software\\Google\\Update\\ClientStateMedium\\")
+ .append(app_guid);
+}
+
+} // namespace
+
+std::wstring GetClientStateKeyPath(const wchar_t* app_guid) {
+ if (!kUseGoogleUpdateIntegration)
+ return GetUnregisteredKeyPathForProduct(kProductPathName);
+ return GetClientStateKeyPathForApp(app_guid);
+}
+
+std::wstring GetBinariesClientStateKeyPath() {
+ if (!kUseGoogleUpdateIntegration)
+ return GetUnregisteredKeyPathForProduct(kBinariesPathName);
+ return GetClientStateKeyPathForApp(kBinariesAppGuid);
+}
+
+std::wstring GetClientStateMediumKeyPath(const wchar_t* app_guid) {
+ if (!kUseGoogleUpdateIntegration)
+ return GetUnregisteredKeyPathForProduct(kProductPathName);
+ return GetClientStateMediumKeyPathForApp(app_guid);
+}
+
+std::wstring GetBinariesClientStateMediumKeyPath() {
+ if (!kUseGoogleUpdateIntegration)
+ return GetUnregisteredKeyPathForProduct(kBinariesPathName);
+ return GetClientStateMediumKeyPathForApp(kBinariesAppGuid);
+}
+
+} // namespace install_static

Powered by Google App Engine
This is Rietveld 408576698