| 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[]; |
| 61 | 63 |
| 62 // Returns true if |exe_path| points to a Chrome installed in an SxS | 64 // Returns true if |exe_path| points to a Chrome installed in an SxS |
| 63 // installation. | 65 // installation. |
| 64 bool IsSxSChrome(const wchar_t* exe_path); | 66 bool IsSxSChrome(const wchar_t* exe_path); |
| 65 | 67 |
| 66 // Returns true if |exe_path| points to a per-user level Chrome installation. | 68 // Returns true if |exe_path| points to a per-user level Chrome installation. |
| 67 bool IsSystemInstall(const wchar_t* exe_path); | 69 bool IsSystemInstall(const wchar_t* exe_path); |
| 68 | 70 |
| 69 // Returns true if current installation of Chrome is a multi-install. | 71 // Returns true if current installation of Chrome is a multi-install. |
| 70 bool IsMultiInstall(bool is_system_install); | 72 bool IsMultiInstall(bool is_system_install); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // Compares version strings of the form "X.X.X.X" and returns the result of the | 198 // Compares version strings of the form "X.X.X.X" and returns the result of the |
| 197 // comparison in the |result| parameter. The result is as below: | 199 // comparison in the |result| parameter. The result is as below: |
| 198 // 0 if the versions are equal. | 200 // 0 if the versions are equal. |
| 199 // -1 if version1 < version2. | 201 // -1 if version1 < version2. |
| 200 // 1 if version1 > version2. | 202 // 1 if version1 > version2. |
| 201 // Returns true on success, false on invalid strings being passed, etc. | 203 // Returns true on success, false on invalid strings being passed, etc. |
| 202 bool CompareVersionStrings(const std::string& version1, | 204 bool CompareVersionStrings(const std::string& version1, |
| 203 const std::string& version2, | 205 const std::string& version2, |
| 204 int* result); | 206 int* result); |
| 205 | 207 |
| 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 |
| 206 // Caches the |ProcessType| of the current process. | 214 // Caches the |ProcessType| of the current process. |
| 207 extern ProcessType g_process_type; | 215 extern ProcessType g_process_type; |
| 208 | 216 |
| 209 } // namespace install_static | 217 } // namespace install_static |
| 210 | 218 |
| 211 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ | 219 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ |
| OLD | NEW |