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 16 matching lines...) Expand all Loading... |
27 extern const wchar_t kChromeChannelUnknown[]; | 27 extern const wchar_t kChromeChannelUnknown[]; |
28 extern const wchar_t kChromeChannelCanary[]; | 28 extern const wchar_t kChromeChannelCanary[]; |
29 extern const wchar_t kChromeChannelDev[]; | 29 extern const wchar_t kChromeChannelDev[]; |
30 extern const wchar_t kChromeChannelBeta[]; | 30 extern const wchar_t kChromeChannelBeta[]; |
31 extern const wchar_t kChromeChannelStable[]; | 31 extern const wchar_t kChromeChannelStable[]; |
32 extern const wchar_t kChromeChannelStableExplicit[]; | 32 extern const wchar_t kChromeChannelStableExplicit[]; |
33 extern const wchar_t kRegPathClientState[]; | 33 extern const wchar_t kRegPathClientState[]; |
34 extern const wchar_t kRegPathClientStateMedium[]; | 34 extern const wchar_t kRegPathClientStateMedium[]; |
35 extern const wchar_t kRegPathChromePolicy[]; | 35 extern const wchar_t kRegPathChromePolicy[]; |
36 extern const wchar_t kRegApField[]; | 36 extern const wchar_t kRegApField[]; |
| 37 // Used to retrieve consent for uploading crashes and metrics. |
37 extern const wchar_t kRegValueUsageStats[]; | 38 extern const wchar_t kRegValueUsageStats[]; |
38 extern const wchar_t kUninstallArgumentsField[]; | 39 extern const wchar_t kUninstallArgumentsField[]; |
39 extern const wchar_t kMetricsReportingEnabled[]; | 40 extern const wchar_t kMetricsReportingEnabled[]; |
40 extern const wchar_t kAppGuidCanary[]; | 41 extern const wchar_t kAppGuidCanary[]; |
41 extern const wchar_t kAppGuidGoogleChrome[]; | 42 extern const wchar_t kAppGuidGoogleChrome[]; |
42 extern const wchar_t kAppGuidGoogleBinaries[]; | 43 extern const wchar_t kAppGuidGoogleBinaries[]; |
43 | 44 |
44 // TODO(ananta) | 45 // TODO(ananta) |
45 // https://crbug.com/604923 | 46 // https://crbug.com/604923 |
46 // Unify these constants with env_vars.h. | 47 // Unify these constants with env_vars.h. |
(...skipping 24 matching lines...) Expand all Loading... |
71 | 72 |
72 // Returns true if usage stats collecting is enabled for this user for the | 73 // Returns true if usage stats collecting is enabled for this user for the |
73 // current executable. | 74 // current executable. |
74 bool GetCollectStatsConsent(); | 75 bool GetCollectStatsConsent(); |
75 | 76 |
76 // Returns true if usage stats collecting is enabled for this user for the | 77 // Returns true if usage stats collecting is enabled for this user for the |
77 // executable passed in as |exe_path|. | 78 // executable passed in as |exe_path|. |
78 // Only used by tests. | 79 // Only used by tests. |
79 bool GetCollectStatsConsentForTesting(const std::wstring& exe_path); | 80 bool GetCollectStatsConsentForTesting(const std::wstring& exe_path); |
80 | 81 |
| 82 // Returns true if the current executable is currently in the chosen sample that |
| 83 // will report stats and crashes. |
| 84 bool GetCollectStatsInSample(); |
| 85 |
| 86 // Sets the registry value used for checking if Chrome is in the chosen sample |
| 87 // that will report stats and crashes. Returns true if writing was successful. |
| 88 bool SetCollectStatsInSample(bool in_sample); |
| 89 |
81 // Returns true if if usage stats reporting is controlled by a mandatory | 90 // Returns true if if usage stats reporting is controlled by a mandatory |
82 // policy. |metrics_is_enforced_by_policy| will be set to true accordingly. | 91 // policy. |metrics_is_enforced_by_policy| will be set to true accordingly. |
83 // TODO(ananta) | 92 // TODO(ananta) |
84 // Make this function private to install_util. | 93 // Make this function private to install_util. |
85 bool ReportingIsEnforcedByPolicy(bool* metrics_is_enforced_by_policy); | 94 bool ReportingIsEnforcedByPolicy(bool* metrics_is_enforced_by_policy); |
86 | 95 |
87 // Initializes |g_process_type| which stores whether or not the current | 96 // Initializes |g_process_type| which stores whether or not the current |
88 // process is the main browser process. | 97 // process is the main browser process. |
89 void InitializeProcessType(); | 98 void InitializeProcessType(); |
90 | 99 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 // value of the |switch_name| passed in. | 216 // value of the |switch_name| passed in. |
208 std::string GetSwitchValueFromCommandLine(const std::string& command_line, | 217 std::string GetSwitchValueFromCommandLine(const std::string& command_line, |
209 const std::string& switch_name); | 218 const std::string& switch_name); |
210 | 219 |
211 // Caches the |ProcessType| of the current process. | 220 // Caches the |ProcessType| of the current process. |
212 extern ProcessType g_process_type; | 221 extern ProcessType g_process_type; |
213 | 222 |
214 } // namespace install_static | 223 } // namespace install_static |
215 | 224 |
216 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ | 225 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ |
OLD | NEW |