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_ |
11 #define CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ | 11 #define CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ |
12 | 12 |
13 #include <string> | 13 #include <string> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
| 16 namespace version_info { |
| 17 enum class Channel; |
| 18 } |
| 19 |
16 namespace install_static { | 20 namespace install_static { |
17 | 21 |
18 struct InstallConstants; | 22 struct InstallConstants; |
19 | 23 |
20 enum class ProcessType { | 24 enum class ProcessType { |
21 UNINITIALIZED, | 25 UNINITIALIZED, |
22 NON_BROWSER_PROCESS, | 26 NON_BROWSER_PROCESS, |
23 BROWSER_PROCESS, | 27 BROWSER_PROCESS, |
24 }; | 28 }; |
25 | 29 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // from the version resource. |exe_path| is the path of chrome.exe. | 188 // from the version resource. |exe_path| is the path of chrome.exe. |
185 // TODO(ananta) | 189 // TODO(ananta) |
186 // http://crbug.com/604923 | 190 // http://crbug.com/604923 |
187 // Unify this with the Browser Distribution code. | 191 // Unify this with the Browser Distribution code. |
188 void GetExecutableVersionDetails(const std::wstring& exe_path, | 192 void GetExecutableVersionDetails(const std::wstring& exe_path, |
189 std::wstring* product_name, | 193 std::wstring* product_name, |
190 std::wstring* version, | 194 std::wstring* version, |
191 std::wstring* special_build, | 195 std::wstring* special_build, |
192 std::wstring* channel_name); | 196 std::wstring* channel_name); |
193 | 197 |
194 // Gets the channel name for the current Chrome process. | 198 // Gets the channel or channel name for the current Chrome process. |
| 199 version_info::Channel GetChromeChannel(); |
195 std::wstring GetChromeChannelName(); | 200 std::wstring GetChromeChannelName(); |
196 | 201 |
197 // Returns true if the |source| string matches the |pattern|. The pattern | 202 // Returns true if the |source| string matches the |pattern|. The pattern |
198 // may contain wildcards like '?', which matches one character or a '*' | 203 // may contain wildcards like '?', which matches one character or a '*' |
199 // which matches 0 or more characters. | 204 // which matches 0 or more characters. |
200 // Please note that pattern matches the whole string. If you want to find | 205 // Please note that pattern matches the whole string. If you want to find |
201 // something in the middle of the string then you need to specify the pattern | 206 // something in the middle of the string then you need to specify the pattern |
202 // as '*xyz*'. | 207 // as '*xyz*'. |
203 bool MatchPattern(const std::wstring& source, const std::wstring& pattern); | 208 bool MatchPattern(const std::wstring& source, const std::wstring& pattern); |
204 | 209 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 bool from_binaries, | 252 bool from_binaries, |
248 std::wstring* update_ap, | 253 std::wstring* update_ap, |
249 std::wstring* update_cohort_name); | 254 std::wstring* update_cohort_name); |
250 | 255 |
251 // Caches the |ProcessType| of the current process. | 256 // Caches the |ProcessType| of the current process. |
252 extern ProcessType g_process_type; | 257 extern ProcessType g_process_type; |
253 | 258 |
254 } // namespace install_static | 259 } // namespace install_static |
255 | 260 |
256 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ | 261 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ |
OLD | NEW |