OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // This file contains helper functions which provide information about the | 4 // This file contains helper functions which provide information about the |
5 // current version of Chrome. This includes channel information, version | 5 // current version of Chrome. This includes channel information, version |
6 // information etc. This functionality is provided by using functions in | 6 // information etc. This functionality is provided by using functions in |
7 // kernel32 and advapi32. No other dependencies are allowed in this file. | 7 // kernel32 and advapi32. No other dependencies are allowed in this file. |
8 | 8 |
9 #ifndef CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ | 9 #ifndef CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ |
10 #define CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ | 10 #define CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 extern const wchar_t kRestartInfo[]; | 51 extern const wchar_t kRestartInfo[]; |
52 extern const wchar_t kRtlLocale[]; | 52 extern const wchar_t kRtlLocale[]; |
53 | 53 |
54 // TODO(ananta) | 54 // TODO(ananta) |
55 // https://crbug.com/604923 | 55 // https://crbug.com/604923 |
56 // Unify these constants with those defined in content_switches.h. | 56 // Unify these constants with those defined in content_switches.h. |
57 extern const char kGpuProcess[]; | 57 extern const char kGpuProcess[]; |
58 extern const char kPpapiPluginProcess[]; | 58 extern const char kPpapiPluginProcess[]; |
59 extern const char kRendererProcess[]; | 59 extern const char kRendererProcess[]; |
60 extern const char kUtilityProcess[]; | 60 extern const char kUtilityProcess[]; |
61 extern const char kProcessType[]; | |
62 extern const char kCrashpadHandler[]; | |
63 | 61 |
64 // Returns true if |exe_path| points to a Chrome installed in an SxS | 62 // Returns true if |exe_path| points to a Chrome installed in an SxS |
65 // installation. | 63 // installation. |
66 bool IsSxSChrome(const wchar_t* exe_path); | 64 bool IsSxSChrome(const wchar_t* exe_path); |
67 | 65 |
68 // Returns true if |exe_path| points to a per-user level Chrome installation. | 66 // Returns true if |exe_path| points to a per-user level Chrome installation. |
69 bool IsSystemInstall(const wchar_t* exe_path); | 67 bool IsSystemInstall(const wchar_t* exe_path); |
70 | 68 |
71 // Returns true if current installation of Chrome is a multi-install. | 69 // Returns true if current installation of Chrome is a multi-install. |
72 bool IsMultiInstall(bool is_system_install); | 70 bool IsMultiInstall(bool is_system_install); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 // Compares version strings of the form "X.X.X.X" and returns the result of the | 196 // Compares version strings of the form "X.X.X.X" and returns the result of the |
199 // comparison in the |result| parameter. The result is as below: | 197 // comparison in the |result| parameter. The result is as below: |
200 // 0 if the versions are equal. | 198 // 0 if the versions are equal. |
201 // -1 if version1 < version2. | 199 // -1 if version1 < version2. |
202 // 1 if version1 > version2. | 200 // 1 if version1 > version2. |
203 // Returns true on success, false on invalid strings being passed, etc. | 201 // Returns true on success, false on invalid strings being passed, etc. |
204 bool CompareVersionStrings(const std::string& version1, | 202 bool CompareVersionStrings(const std::string& version1, |
205 const std::string& version2, | 203 const std::string& version2, |
206 int* result); | 204 int* result); |
207 | 205 |
208 // We assume that the command line |command_line| contains multiple switches | |
209 // with the format --<switch name>=<switch value>. This function returns the | |
210 // value of the |switch_name| passed in. | |
211 std::string GetSwitchValueFromCommandLine(const std::string& command_line, | |
212 const std::string& switch_name); | |
213 | |
214 // Caches the |ProcessType| of the current process. | 206 // Caches the |ProcessType| of the current process. |
215 extern ProcessType g_process_type; | 207 extern ProcessType g_process_type; |
216 | 208 |
217 } // namespace install_static | 209 } // namespace install_static |
218 | 210 |
219 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ | 211 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ |
OLD | NEW |