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 // Registry key to store the stats/crash sampling state of Chrome. If set to 1, | |
| 45 // stats and crash reports will be uploaded in line with the user's consent, | |
| 46 // otherwise, uploads will be dissabled. It is used to sample clients, to reduce | |
|
robertshield
2016/08/12 17:49:25
s/dissabled/disabled/
jwd
2016/08/12 20:04:31
Done.
| |
| 47 // server load for metics and crashes. This is controlled by the | |
| 48 // MetricsReporting feature in chrome_metrics_services_manager_client.cc and is | |
| 49 // written when metrics services are started up and when consent changes. | |
| 50 extern const wchar_t kChromeStatsSampleKey[]; | |
|
Alexei Svitkine (slow)
2016/08/12 17:47:48
Since this is no longer used outside of the .cc fi
robertshield
2016/08/12 17:49:25
What is the relationship between the value stored
jwd
2016/08/12 20:04:30
Done.
jwd
2016/08/12 20:04:31
kRegValueUsageStats is the source of consent descr
| |
| 51 | |
| 44 // TODO(ananta) | 52 // TODO(ananta) |
| 45 // https://crbug.com/604923 | 53 // https://crbug.com/604923 |
| 46 // Unify these constants with env_vars.h. | 54 // Unify these constants with env_vars.h. |
| 47 extern const wchar_t kHeadless[]; | 55 extern const wchar_t kHeadless[]; |
| 48 extern const wchar_t kShowRestart[]; | 56 extern const wchar_t kShowRestart[]; |
| 49 extern const wchar_t kRestartInfo[]; | 57 extern const wchar_t kRestartInfo[]; |
| 50 extern const wchar_t kRtlLocale[]; | 58 extern const wchar_t kRtlLocale[]; |
| 51 | 59 |
| 52 // TODO(ananta) | 60 // TODO(ananta) |
| 53 // https://crbug.com/604923 | 61 // https://crbug.com/604923 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 71 | 79 |
| 72 // Returns true if usage stats collecting is enabled for this user for the | 80 // Returns true if usage stats collecting is enabled for this user for the |
| 73 // current executable. | 81 // current executable. |
| 74 bool GetCollectStatsConsent(); | 82 bool GetCollectStatsConsent(); |
| 75 | 83 |
| 76 // Returns true if usage stats collecting is enabled for this user for the | 84 // Returns true if usage stats collecting is enabled for this user for the |
| 77 // executable passed in as |exe_path|. | 85 // executable passed in as |exe_path|. |
| 78 // Only used by tests. | 86 // Only used by tests. |
| 79 bool GetCollectStatsConsentForTesting(const std::wstring& exe_path); | 87 bool GetCollectStatsConsentForTesting(const std::wstring& exe_path); |
| 80 | 88 |
| 89 // Returns true if the current executable is currently in the chosen sample that | |
| 90 // will report stats and crashes. | |
| 91 bool GetCollectStatsInSample(); | |
| 92 | |
| 93 // Sets the registry value used for checking if Chrome is in the chosen sample | |
| 94 // that will report stats and crashes. Returns true if writing was successful. | |
| 95 bool SetCollectStatsInSample(bool in_sample); | |
| 96 | |
| 81 // Returns true if if usage stats reporting is controlled by a mandatory | 97 // 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. | 98 // policy. |metrics_is_enforced_by_policy| will be set to true accordingly. |
| 83 // TODO(ananta) | 99 // TODO(ananta) |
| 84 // Make this function private to install_util. | 100 // Make this function private to install_util. |
| 85 bool ReportingIsEnforcedByPolicy(bool* metrics_is_enforced_by_policy); | 101 bool ReportingIsEnforcedByPolicy(bool* metrics_is_enforced_by_policy); |
| 86 | 102 |
| 87 // Initializes |g_process_type| which stores whether or not the current | 103 // Initializes |g_process_type| which stores whether or not the current |
| 88 // process is the main browser process. | 104 // process is the main browser process. |
| 89 void InitializeProcessType(); | 105 void InitializeProcessType(); |
| 90 | 106 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 // value of the |switch_name| passed in. | 223 // value of the |switch_name| passed in. |
| 208 std::string GetSwitchValueFromCommandLine(const std::string& command_line, | 224 std::string GetSwitchValueFromCommandLine(const std::string& command_line, |
| 209 const std::string& switch_name); | 225 const std::string& switch_name); |
| 210 | 226 |
| 211 // Caches the |ProcessType| of the current process. | 227 // Caches the |ProcessType| of the current process. |
| 212 extern ProcessType g_process_type; | 228 extern ProcessType g_process_type; |
| 213 | 229 |
| 214 } // namespace install_static | 230 } // namespace install_static |
| 215 | 231 |
| 216 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ | 232 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ |
| OLD | NEW |