| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Contains functions for determining the product's InstallDetails at runtime. | |
| 6 | |
| 7 #ifndef CHROME_INSTALL_STATIC_PRODUCT_INSTALL_DETAILS_H_ | |
| 8 #define CHROME_INSTALL_STATIC_PRODUCT_INSTALL_DETAILS_H_ | |
| 9 | |
| 10 #include <memory> | |
| 11 #include <string> | |
| 12 | |
| 13 namespace install_static { | |
| 14 | |
| 15 struct InstallConstants; | |
| 16 class PrimaryInstallDetails; | |
| 17 | |
| 18 // Creates product details for the current process and sets them as the global | |
| 19 // InstallDetails for the process. This is intended to be called early in | |
| 20 // process startup. A process's "primary" module may be the executable itself or | |
| 21 // may be another DLL that is loaded and initialized prior to executing the | |
| 22 // executable's entrypoint (i.e., chrome_elf.dll). | |
| 23 void InitializeProductDetailsForPrimaryModule(); | |
| 24 | |
| 25 // Returns true if |parent| is a parent of |path|. Path separators at the end of | |
| 26 // |parent| are ignored. Returns false if |parent| is empty. | |
| 27 bool IsPathParentOf(const wchar_t* parent, | |
| 28 size_t parent_len, | |
| 29 const std::wstring& path); | |
| 30 | |
| 31 // Returns true if |path| is within C:\Program Files{, (x86)}. | |
| 32 bool PathIsInProgramFiles(const std::wstring& path); | |
| 33 | |
| 34 // Returns the install suffix embedded in |exe_path| or an empty string if none | |
| 35 // is found. |exe_path| is expected be something similar to | |
| 36 // "...\[kProductName][suffix]\Application". | |
| 37 std::wstring GetInstallSuffix(const std::wstring& exe_path); | |
| 38 | |
| 39 // Returns true if the browser of |mode| at |system_level| is registered as | |
| 40 // being multi-install. | |
| 41 bool IsMultiInstall(const InstallConstants& mode, bool system_level); | |
| 42 | |
| 43 // Creates product details for the process at |exe_path|. | |
| 44 std::unique_ptr<PrimaryInstallDetails> MakeProductDetails( | |
| 45 const std::wstring& exe_path); | |
| 46 | |
| 47 } // namespace install_static | |
| 48 | |
| 49 #endif // CHROME_INSTALL_STATIC_PRODUCT_INSTALL_DETAILS_H_ | |
| OLD | NEW |