Chromium Code Reviews| 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 23 matching lines...) Expand all Loading... | |
| 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 extern const wchar_t kRegValueUsageStats[]; | 37 extern const wchar_t kRegValueUsageStats[]; |
| 38 extern const wchar_t kUninstallArgumentsField[]; | 38 extern const wchar_t kUninstallArgumentsField[]; |
| 39 extern const wchar_t kMetricsReportingEnabled[]; | 39 extern const wchar_t kMetricsReportingEnabled[]; |
| 40 extern const wchar_t kAppGuidCanary[]; | 40 extern const wchar_t kAppGuidCanary[]; |
| 41 extern const wchar_t kAppGuidGoogleChrome[]; | 41 extern const wchar_t kAppGuidGoogleChrome[]; |
| 42 extern const wchar_t kAppGuidGoogleBinaries[]; | 42 extern const wchar_t kAppGuidGoogleBinaries[]; |
| 43 | 43 |
| 44 extern const wchar_t kChromeMetrics[]; | |
| 45 extern const wchar_t kChromeStatsSampleKey[]; | |
|
Alexei Svitkine (slow)
2016/08/10 21:49:33
Are you missing the bit that sets these?
jwd
2016/08/11 21:41:03
Moved setting from chrome_metrics_services_client
| |
| 46 | |
| 44 // TODO(ananta) | 47 // TODO(ananta) |
| 45 // https://crbug.com/604923 | 48 // https://crbug.com/604923 |
| 46 // Unify these constants with env_vars.h. | 49 // Unify these constants with env_vars.h. |
| 47 extern const wchar_t kHeadless[]; | 50 extern const wchar_t kHeadless[]; |
| 48 extern const wchar_t kShowRestart[]; | 51 extern const wchar_t kShowRestart[]; |
| 49 extern const wchar_t kRestartInfo[]; | 52 extern const wchar_t kRestartInfo[]; |
| 50 extern const wchar_t kRtlLocale[]; | 53 extern const wchar_t kRtlLocale[]; |
| 51 | 54 |
| 52 // TODO(ananta) | 55 // TODO(ananta) |
| 53 // https://crbug.com/604923 | 56 // https://crbug.com/604923 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 71 | 74 |
| 72 // Returns true if usage stats collecting is enabled for this user for the | 75 // Returns true if usage stats collecting is enabled for this user for the |
| 73 // current executable. | 76 // current executable. |
| 74 bool GetCollectStatsConsent(); | 77 bool GetCollectStatsConsent(); |
| 75 | 78 |
| 76 // Returns true if usage stats collecting is enabled for this user for the | 79 // Returns true if usage stats collecting is enabled for this user for the |
| 77 // executable passed in as |exe_path|. | 80 // executable passed in as |exe_path|. |
| 78 // Only used by tests. | 81 // Only used by tests. |
| 79 bool GetCollectStatsConsentForTesting(const std::wstring& exe_path); | 82 bool GetCollectStatsConsentForTesting(const std::wstring& exe_path); |
| 80 | 83 |
| 84 // Returns false if the current executable is affected by stats collection | |
|
rkaplow
2016/08/10 20:16:29
this is ok, but IMO would be more intuitive as
jwd
2016/08/10 22:10:02
I agree the double negation is undesirable. I don'
| |
| 85 // sampling, and shouldn't be reporting stats and crashes. Otherwise, returns | |
| 86 // true. | |
| 87 bool GetCollectStatsInSample(); | |
| 88 | |
| 81 // Returns true if if usage stats reporting is controlled by a mandatory | 89 // 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. | 90 // policy. |metrics_is_enforced_by_policy| will be set to true accordingly. |
| 83 // TODO(ananta) | 91 // TODO(ananta) |
| 84 // Make this function private to install_util. | 92 // Make this function private to install_util. |
| 85 bool ReportingIsEnforcedByPolicy(bool* metrics_is_enforced_by_policy); | 93 bool ReportingIsEnforcedByPolicy(bool* metrics_is_enforced_by_policy); |
| 86 | 94 |
| 87 // Initializes |g_process_type| which stores whether or not the current | 95 // Initializes |g_process_type| which stores whether or not the current |
| 88 // process is the main browser process. | 96 // process is the main browser process. |
| 89 void InitializeProcessType(); | 97 void InitializeProcessType(); |
| 90 | 98 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 // value of the |switch_name| passed in. | 215 // value of the |switch_name| passed in. |
| 208 std::string GetSwitchValueFromCommandLine(const std::string& command_line, | 216 std::string GetSwitchValueFromCommandLine(const std::string& command_line, |
| 209 const std::string& switch_name); | 217 const std::string& switch_name); |
| 210 | 218 |
| 211 // Caches the |ProcessType| of the current process. | 219 // Caches the |ProcessType| of the current process. |
| 212 extern ProcessType g_process_type; | 220 extern ProcessType g_process_type; |
| 213 | 221 |
| 214 } // namespace install_static | 222 } // namespace install_static |
| 215 | 223 |
| 216 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ | 224 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ |
| OLD | NEW |