| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/install_static/install_util.h" | 5 #include "chrome/install_static/install_util.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <assert.h> | 8 #include <assert.h> |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <iostream> | 10 #include <iostream> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 L"Software\\Google\\Update\\ClientStateMedium"; | 38 L"Software\\Google\\Update\\ClientStateMedium"; |
| 39 const wchar_t kRegPathChromePolicy[] = L"SOFTWARE\\Policies\\Google\\Chrome"; | 39 const wchar_t kRegPathChromePolicy[] = L"SOFTWARE\\Policies\\Google\\Chrome"; |
| 40 #else | 40 #else |
| 41 const wchar_t kRegPathClientState[] = | 41 const wchar_t kRegPathClientState[] = |
| 42 L"Software\\Chromium\\Update\\ClientState"; | 42 L"Software\\Chromium\\Update\\ClientState"; |
| 43 const wchar_t kRegPathClientStateMedium[] = | 43 const wchar_t kRegPathClientStateMedium[] = |
| 44 L"Software\\Chromium\\Update\\ClientStateMedium"; | 44 L"Software\\Chromium\\Update\\ClientStateMedium"; |
| 45 const wchar_t kRegPathChromePolicy[] = L"SOFTWARE\\Policies\\Chromium"; | 45 const wchar_t kRegPathChromePolicy[] = L"SOFTWARE\\Policies\\Chromium"; |
| 46 #endif | 46 #endif |
| 47 | 47 |
| 48 const wchar_t kRegValueChromeStatsSample[] = L"UsageStatsInSample"; |
| 48 const wchar_t kRegValueUsageStats[] = L"usagestats"; | 49 const wchar_t kRegValueUsageStats[] = L"usagestats"; |
| 49 const wchar_t kUninstallArgumentsField[] = L"UninstallArguments"; | 50 const wchar_t kUninstallArgumentsField[] = L"UninstallArguments"; |
| 50 const wchar_t kMetricsReportingEnabled[] = L"MetricsReportingEnabled"; | 51 const wchar_t kMetricsReportingEnabled[] = L"MetricsReportingEnabled"; |
| 51 | 52 |
| 52 const wchar_t kAppGuidCanary[] = L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}"; | 53 const wchar_t kAppGuidCanary[] = L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}"; |
| 53 const wchar_t kAppGuidGoogleChrome[] = | 54 const wchar_t kAppGuidGoogleChrome[] = |
| 54 L"{8A69D345-D564-463c-AFF1-A69D9E530F96}"; | 55 L"{8A69D345-D564-463c-AFF1-A69D9E530F96}"; |
| 55 const wchar_t kAppGuidGoogleBinaries[] = | 56 const wchar_t kAppGuidGoogleBinaries[] = |
| 56 L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}"; | 57 L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}"; |
| 57 | 58 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 80 #else | 81 #else |
| 81 const wchar_t kChromiumInstallSubDir[] = L"Chromium"; | 82 const wchar_t kChromiumInstallSubDir[] = L"Chromium"; |
| 82 #endif // defined(GOOGLE_CHROME_BUILD) | 83 #endif // defined(GOOGLE_CHROME_BUILD) |
| 83 | 84 |
| 84 const wchar_t kUserDataDirname[] = L"User Data"; | 85 const wchar_t kUserDataDirname[] = L"User Data"; |
| 85 const wchar_t kBrowserCrashDumpMetricsSubKey[] = L"\\BrowserCrashDumpAttempts"; | 86 const wchar_t kBrowserCrashDumpMetricsSubKey[] = L"\\BrowserCrashDumpAttempts"; |
| 86 | 87 |
| 87 const wchar_t kRegPathGoogleUpdate[] = L"Software\\Google\\Update"; | 88 const wchar_t kRegPathGoogleUpdate[] = L"Software\\Google\\Update"; |
| 88 const wchar_t kRegGoogleUpdateVersion[] = L"version"; | 89 const wchar_t kRegGoogleUpdateVersion[] = L"version"; |
| 89 | 90 |
| 90 // Registry key to store the stats/crash sampling state of Chrome. If set to 1, | |
| 91 // stats and crash reports will be uploaded in line with the user's consent, | |
| 92 // otherwise, uploads will be disabled. It is used to sample clients, to reduce | |
| 93 // server load for metics and crashes. This is controlled by the | |
| 94 // MetricsReporting feature in chrome_metrics_services_manager_client.cc and is | |
| 95 // written when metrics services are started up and when consent changes. | |
| 96 const wchar_t kRegValueChromeStatsSample[] = L"UsageStatsInSample"; | |
| 97 | |
| 98 void Trace(const wchar_t* format_string, ...) { | 91 void Trace(const wchar_t* format_string, ...) { |
| 99 static const int kMaxLogBufferSize = 1024; | 92 static const int kMaxLogBufferSize = 1024; |
| 100 static wchar_t buffer[kMaxLogBufferSize] = {}; | 93 static wchar_t buffer[kMaxLogBufferSize] = {}; |
| 101 | 94 |
| 102 va_list args = {}; | 95 va_list args = {}; |
| 103 | 96 |
| 104 va_start(args, format_string); | 97 va_start(args, format_string); |
| 105 vswprintf(buffer, kMaxLogBufferSize, format_string, args); | 98 vswprintf(buffer, kMaxLogBufferSize, format_string, args); |
| 106 OutputDebugStringW(buffer); | 99 OutputDebugStringW(buffer); |
| 107 va_end(args); | 100 va_end(args); |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 switch_value_end_offset = command_line_copy.length(); | 880 switch_value_end_offset = command_line_copy.length(); |
| 888 | 881 |
| 889 std::string switch_value = command_line_copy.substr( | 882 std::string switch_value = command_line_copy.substr( |
| 890 switch_value_start_offset, | 883 switch_value_start_offset, |
| 891 switch_value_end_offset - (switch_offset + switch_token.length())); | 884 switch_value_end_offset - (switch_offset + switch_token.length())); |
| 892 TrimT<std::string>(&switch_value); | 885 TrimT<std::string>(&switch_value); |
| 893 return switch_value; | 886 return switch_value; |
| 894 } | 887 } |
| 895 | 888 |
| 896 } // namespace install_static | 889 } // namespace install_static |
| OLD | NEW |