OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/browser/component_updater/sw_reporter_installer_win.h" | 5 #include "chrome/browser/component_updater/sw_reporter_installer_win.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 243 |
244 base::CommandLine command_line(argv); | 244 base::CommandLine command_line(argv); |
245 | 245 |
246 // Add a random session id to link experimental reporter runs together. | 246 // Add a random session id to link experimental reporter runs together. |
247 command_line.AppendSwitchASCII(chrome_cleaner::kSessionIdSwitch, | 247 command_line.AppendSwitchASCII(chrome_cleaner::kSessionIdSwitch, |
248 session_id); | 248 session_id); |
249 | 249 |
250 const std::string experiment_group = | 250 const std::string experiment_group = |
251 variations::GetVariationParamValueByFeature( | 251 variations::GetVariationParamValueByFeature( |
252 kExperimentalEngineFeature, "experiment_group_for_reporting"); | 252 kExperimentalEngineFeature, "experiment_group_for_reporting"); |
253 command_line.AppendSwitchNative("engine-experiment-group", | 253 command_line.AppendSwitchNative( |
254 experiment_group.empty() | 254 chrome_cleaner::kEngineExperimentGroupSwitch, |
255 ? L"missing_experiment_group" | 255 experiment_group.empty() ? L"missing_experiment_group" |
256 : base::UTF8ToUTF16(experiment_group)); | 256 : base::UTF8ToUTF16(experiment_group)); |
257 | 257 |
258 // Add the histogram suffix to the command-line as well, so that the | 258 // Add the histogram suffix to the command-line as well, so that the |
259 // reporter will add the same suffix to registry keys where it writes | 259 // reporter will add the same suffix to registry keys where it writes |
260 // metrics. | 260 // metrics. |
261 if (!suffix.empty()) | 261 if (!suffix.empty()) |
262 command_line.AppendSwitchASCII("registry-suffix", suffix); | 262 command_line.AppendSwitchASCII(chrome_cleaner::kRegistrySuffixSwitch, |
| 263 suffix); |
263 | 264 |
264 SwReporterInvocation::Behaviours supported_behaviours = 0; | 265 SwReporterInvocation::Behaviours supported_behaviours = 0; |
265 if (!GetOptionalBehaviour(invocation_params, "prompt", | 266 if (!GetOptionalBehaviour(invocation_params, "prompt", |
266 SwReporterInvocation::BEHAVIOUR_TRIGGER_PROMPT, | 267 SwReporterInvocation::BEHAVIOUR_TRIGGER_PROMPT, |
267 &supported_behaviours)) | 268 &supported_behaviours)) |
268 return; | 269 return; |
269 if (!GetOptionalBehaviour( | 270 if (!GetOptionalBehaviour( |
270 invocation_params, "allow-reporter-logs", | 271 invocation_params, "allow-reporter-logs", |
271 SwReporterInvocation::BEHAVIOUR_ALLOW_SEND_REPORTER_LOGS, | 272 SwReporterInvocation::BEHAVIOUR_ALLOW_SEND_REPORTER_LOGS, |
272 &supported_behaviours)) | 273 &supported_behaviours)) |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 } | 492 } |
492 | 493 |
493 void RegisterProfilePrefsForSwReporter( | 494 void RegisterProfilePrefsForSwReporter( |
494 user_prefs::PrefRegistrySyncable* registry) { | 495 user_prefs::PrefRegistrySyncable* registry) { |
495 registry->RegisterStringPref(prefs::kSwReporterPromptVersion, ""); | 496 registry->RegisterStringPref(prefs::kSwReporterPromptVersion, ""); |
496 | 497 |
497 registry->RegisterStringPref(prefs::kSwReporterPromptSeed, ""); | 498 registry->RegisterStringPref(prefs::kSwReporterPromptSeed, ""); |
498 } | 499 } |
499 | 500 |
500 } // namespace component_updater | 501 } // namespace component_updater |
OLD | NEW |