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

Unified Diff: chrome/install_static/product_install_details.h

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/product_install_details.h
diff --git a/chrome/install_static/product_install_details.h b/chrome/install_static/product_install_details.h
new file mode 100644
index 0000000000000000000000000000000000000000..54843b6c7c051de4870f41c4897404724c8e3952
--- /dev/null
+++ b/chrome/install_static/product_install_details.h
@@ -0,0 +1,49 @@
+// 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.
+
+// Contains functions for determining the product's InstallDetails at runtime.
+
+#ifndef CHROME_INSTALL_STATIC_PRODUCT_INSTALL_DETAILS_H_
+#define CHROME_INSTALL_STATIC_PRODUCT_INSTALL_DETAILS_H_
+
+#include <memory>
+#include <string>
+
+namespace install_static {
+
+struct InstallConstants;
+class PrimaryInstallDetails;
+
+// Creates product details for the current process and sets them as the global
+// InstallDetails for the process. This is intended to be called early in
+// process startup. A process's "primary" module may be the executable itself or
+// may be another DLL that is loaded and initialized prior to executing the
+// executable's entrypoint (i.e., chrome_elf.dll).
+void InitializeProductDetailsForPrimaryModule();
+
+// Returns true if |parent| is a parent of |path|. Path separators at the end of
+// |parent| are ignored. Returns false if |parent| is empty.
+bool IsPathParentOf(const wchar_t* parent,
+ size_t parent_len,
+ const std::wstring& path);
+
+// Returns true if |path| is within C:\Program Files{, (x86)}.
+bool PathIsInProgramFiles(const std::wstring& path);
+
+// Returns the install suffix embedded in |exe_path| or an empty string if none
+// is found. |exe_path| is expected be something similar to
+// "...\[kProductName][suffix]\Application".
+std::wstring GetInstallSuffix(const std::wstring& exe_path);
+
+// Returns true if the browser of |mode| at |system_level| is registered as
+// being multi-install.
+bool IsMultiInstall(const InstallConstants& mode, bool system_level);
+
+// Creates product details for the process at |exe_path|.
+std::unique_ptr<PrimaryInstallDetails> MakeProductDetails(
+ const std::wstring& exe_path);
+
+} // namespace install_static
+
+#endif // CHROME_INSTALL_STATIC_PRODUCT_INSTALL_DETAILS_H_

Powered by Google App Engine
This is Rietveld 408576698