Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1278)

Unified Diff: chrome/browser/component_updater/sw_reporter_installer_win.cc

Issue 599633005: Gate the SRTPrompt on a specific FieldTrial group. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merged ToT. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/sw_reporter_installer_win.cc
diff --git a/chrome/browser/component_updater/sw_reporter_installer_win.cc b/chrome/browser/component_updater/sw_reporter_installer_win.cc
index f01f48544c4cfc104ec91fdf58990d45a0022369..693f94e21def3fa0627a2022d3708ec154a55e7b 100644
--- a/chrome/browser/component_updater/sw_reporter_installer_win.cc
+++ b/chrome/browser/component_updater/sw_reporter_installer_win.cc
@@ -15,6 +15,7 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
+#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/metrics/sparse_histogram.h"
#include "base/path_service.h"
@@ -83,6 +84,10 @@ const wchar_t kSoftwareRemovalToolRegistryKey[] =
L"Software\\Google\\Software Removal Tool";
const wchar_t kExitCodeRegistryValueName[] = L"ExitCode";
+// Field trial strings.
+const char kSRTPromptTrialName[] = "SRTPromptFieldTrial";
+const char kSRTPromptOnGroup[] = "On";
+
// Exit codes that identify that a cleanup is needed.
const int kCleanupNeeded = 0;
const int kPostRebootCleanupNeeded = 4;
@@ -125,7 +130,9 @@ void ReportAndClearExitCode(int exit_code, const std::string& version) {
exit_code);
}
- if (exit_code == kPostRebootCleanupNeeded || exit_code == kCleanupNeeded) {
+ if ((exit_code == kPostRebootCleanupNeeded || exit_code == kCleanupNeeded) &&
+ base::FieldTrialList::FindFullName(kSRTPromptTrialName) ==
+ kSRTPromptOnGroup) {
// Find the last active browser, which may be NULL, in which case we won't
// show the prompt this time and will wait until the next run of the
// reporter. We can't use other ways of finding a browser because we don't
@@ -314,6 +321,14 @@ wchar_t SwReporterInstallerTraits::version_dir_[] = {};
void RegisterSwReporterComponent(ComponentUpdateService* cus,
PrefService* prefs) {
+ // The Sw reporter doesn't need to run if the user isn't reporting metrics and
+ // isn't in the SRTPrompt field trial "On" group.
+ if (!ChromeMetricsServiceAccessor::IsMetricsReportingEnabled() &&
+ base::FieldTrialList::FindFullName(kSRTPromptTrialName) !=
+ kSRTPromptOnGroup) {
+ return;
+ }
+
// Install the component.
scoped_ptr<ComponentInstallerTraits> traits(
new SwReporterInstallerTraits(prefs));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698