| 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 | 4 |
| 5 // This file contains helper functions which provide information about the | 5 // This file contains helper functions which provide information about the |
| 6 // current version of Chrome. This includes channel information, version | 6 // current version of Chrome. This includes channel information, version |
| 7 // information etc. This functionality is provided by using functions in | 7 // information etc. This functionality is provided by using functions in |
| 8 // kernel32 and advapi32. No other dependencies are allowed in this file. | 8 // kernel32 and advapi32. No other dependencies are allowed in this file. |
| 9 | 9 |
| 10 #ifndef CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ | 10 #ifndef CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 extern const wchar_t kProcessType[]; | 46 extern const wchar_t kProcessType[]; |
| 47 extern const wchar_t kUserDataDirSwitch[]; | 47 extern const wchar_t kUserDataDirSwitch[]; |
| 48 extern const wchar_t kUtilityProcess[]; | 48 extern const wchar_t kUtilityProcess[]; |
| 49 | 49 |
| 50 // Used for suppressing warnings. | 50 // Used for suppressing warnings. |
| 51 template <typename T> inline void IgnoreUnused(T) {} | 51 template <typename T> inline void IgnoreUnused(T) {} |
| 52 | 52 |
| 53 // Returns true if Chrome is running at system level. | 53 // Returns true if Chrome is running at system level. |
| 54 bool IsSystemInstall(); | 54 bool IsSystemInstall(); |
| 55 | 55 |
| 56 // Returns true if current installation of Chrome is a multi-install. | |
| 57 bool IsMultiInstall(); | |
| 58 | |
| 59 // Returns true if usage stats collecting is enabled for this user for the | 56 // Returns true if usage stats collecting is enabled for this user for the |
| 60 // current executable. | 57 // current executable. |
| 61 bool GetCollectStatsConsent(); | 58 bool GetCollectStatsConsent(); |
| 62 | 59 |
| 63 // Returns true if the current executable is currently in the chosen sample that | 60 // Returns true if the current executable is currently in the chosen sample that |
| 64 // will report stats and crashes. | 61 // will report stats and crashes. |
| 65 bool GetCollectStatsInSample(); | 62 bool GetCollectStatsInSample(); |
| 66 | 63 |
| 67 // Sets the registry value used for checking if Chrome is in the chosen sample | 64 // Sets the registry value used for checking if Chrome is in the chosen sample |
| 68 // that will report stats and crashes. Returns true if writing was successful. | 65 // that will report stats and crashes. Returns true if writing was successful. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // TODO(ananta) | 115 // TODO(ananta) |
| 119 // http://crbug.com/604923 | 116 // http://crbug.com/604923 |
| 120 // Unify this with the Browser Distribution code. | 117 // Unify this with the Browser Distribution code. |
| 121 void GetExecutableVersionDetails(const std::wstring& exe_path, | 118 void GetExecutableVersionDetails(const std::wstring& exe_path, |
| 122 std::wstring* product_name, | 119 std::wstring* product_name, |
| 123 std::wstring* version, | 120 std::wstring* version, |
| 124 std::wstring* special_build, | 121 std::wstring* special_build, |
| 125 std::wstring* channel_name); | 122 std::wstring* channel_name); |
| 126 | 123 |
| 127 // Gets the channel name for the current Chrome process. | 124 // Gets the channel name for the current Chrome process. |
| 128 // If |add_modifier| is true the channel name is returned with the modifier | |
| 129 // prepended to it. Currently this is only done for multi installs, i.e (-m) | |
| 130 // is the only modifier supported. | |
| 131 // TODO(ananta) | 125 // TODO(ananta) |
| 132 // http://crbug.com/604923 | 126 // http://crbug.com/604923 |
| 133 // Unify this with the Browser Distribution code. | 127 // Unify this with the Browser Distribution code. |
| 134 std::wstring GetChromeChannelName(bool add_modifier); | 128 std::wstring GetChromeChannelName(); |
| 135 | 129 |
| 136 // Returns the registry path where the browser crash dumps metrics need to be | 130 // Returns the registry path where the browser crash dumps metrics need to be |
| 137 // written to. | 131 // written to. |
| 138 // TODO(ananta) | 132 // TODO(ananta) |
| 139 // http://crbug.com/604923 | 133 // http://crbug.com/604923 |
| 140 // Unify this with the version in | 134 // Unify this with the version in |
| 141 // chrome\common\metrics_constants_util_win.cc | 135 // chrome\common\metrics_constants_util_win.cc |
| 142 std::wstring GetBrowserCrashDumpAttemptsRegistryPath(); | 136 std::wstring GetBrowserCrashDumpAttemptsRegistryPath(); |
| 143 | 137 |
| 144 // Returns true if the |source| string matches the |pattern|. The pattern | 138 // Returns true if the |source| string matches the |pattern|. The pattern |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 const std::wstring& switch_name); | 171 const std::wstring& switch_name); |
| 178 | 172 |
| 179 // Ensures that the given |full_path| exists, and that the tail component is a | 173 // Ensures that the given |full_path| exists, and that the tail component is a |
| 180 // directory. If the directory does not already exist, it will be created. | 174 // directory. If the directory does not already exist, it will be created. |
| 181 // Returns false if the final component exists but is not a directory, or on | 175 // Returns false if the final component exists but is not a directory, or on |
| 182 // failure to create a directory. | 176 // failure to create a directory. |
| 183 bool RecursiveDirectoryCreate(const std::wstring& full_path); | 177 bool RecursiveDirectoryCreate(const std::wstring& full_path); |
| 184 | 178 |
| 185 // Returns the unadorned channel name based on the channel strategy for the | 179 // Returns the unadorned channel name based on the channel strategy for the |
| 186 // install mode. | 180 // install mode. |
| 187 std::wstring DetermineChannel(const InstallConstants& mode, | 181 std::wstring DetermineChannel(const InstallConstants& mode, bool system_level); |
| 188 bool system_level, | |
| 189 bool multi_install); | |
| 190 | 182 |
| 191 // Caches the |ProcessType| of the current process. | 183 // Caches the |ProcessType| of the current process. |
| 192 extern ProcessType g_process_type; | 184 extern ProcessType g_process_type; |
| 193 | 185 |
| 194 } // namespace install_static | 186 } // namespace install_static |
| 195 | 187 |
| 196 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ | 188 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ |
| OLD | NEW |