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. | |
20 void InitializeModuleProductDetails(); | |
21 | |
22 // Functions from here on down are exposed for the sake of testing. | |
robertshield
2016/10/17 05:27:23
What's the current thinking. re calling things XXX
grt (UTC plus 2)
2016/10/24 11:17:51
I thought it'd be fugly to put that on each of the
robertshield
2016/10/24 14:59:26
If they're suitable for external consumption, I'd
grt (UTC plus 2)
2016/10/24 19:36:00
Done.
| |
23 | |
24 // Returns true if |parent| is a parent of |path|. Path separators at the end of | |
25 // |parent| are ignored. Returns false if |parent| is empty. | |
26 bool IsPathParentOf(const wchar_t* parent, | |
27 size_t parent_len, | |
28 const std::wstring& path); | |
29 | |
30 // Returns true if |path| is within C:\Program Files{, (x86)}. | |
31 bool PathIsInProgramFiles(const std::wstring& path); | |
32 | |
33 // Returns the install suffix embedded in |exe_path| or an empty string if none | |
34 // is found. |exe_path| is expected be something similar to | |
35 // "...\[kProductName][suffix]\Application". | |
36 std::wstring GetInstallSuffix(const std::wstring& exe_path); | |
37 | |
38 // Returns true if the browser of |mode| at |system_level| is registered as | |
39 // being multi-install. | |
40 bool IsMultiInstall(const InstallConstants& mode, bool system_level); | |
41 | |
42 // Creates product details for the process at |exe_path|. | |
43 std::unique_ptr<PrimaryInstallDetails> MakeProductDetails( | |
44 const std::wstring& exe_path); | |
45 | |
46 } // namespace install_static | |
47 | |
48 #endif // CHROME_INSTALL_STATIC_PRODUCT_INSTALL_DETAILS_H_ | |
OLD | NEW |