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

Unified Diff: chrome/browser/extensions/extension_uninstall_dialog.cc

Issue 1025613006: [Extensions] Add a field trial for reporting abuse on uninstall (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/extensions/extension_uninstall_dialog.cc
diff --git a/chrome/browser/extensions/extension_uninstall_dialog.cc b/chrome/browser/extensions/extension_uninstall_dialog.cc
index 01bc7cda9f34eef1988616464f1b10d44b36d2ae..c65bf78f65cdbfa981c02d34f54785be5be2fd29 100644
--- a/chrome/browser/extensions/extension_uninstall_dialog.cc
+++ b/chrome/browser/extensions/extension_uninstall_dialog.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
+#include "base/metrics/field_trial.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/profiles/profile.h"
@@ -128,9 +129,20 @@ std::string ExtensionUninstallDialog::GetHeadingText() {
}
bool ExtensionUninstallDialog::ShouldShowReportAbuseCheckbox() const {
- // TODO(devlin): Add a field trial for reporting abuse on uninstallation.
- // See crbug.com/441377.
- return false;
+ static const char kExperimentName[] = "ExtensionUninstall.ReportAbuse";
+ static const char kDefaultGroupName[] = "Default";
+ static const char kShowCheckboxGroup[] = "ShowCheckbox";
+ // TODO(devlin): Turn on this field trial. See crbug.com/441377.
+ scoped_refptr<base::FieldTrial> trial(
+ base::FieldTrialList::FactoryGetFieldTrial(
+ kExperimentName,
+ 100, // Total probability.
+ kDefaultGroupName,
+ 2015, 7, 31, // End date.
+ base::FieldTrial::ONE_TIME_RANDOMIZED,
+ nullptr));
+ int experiment_group = trial->AppendGroup(kShowCheckboxGroup, 0);
+ return base::FieldTrialList::FindValue(kExperimentName) == experiment_group;
}
void ExtensionUninstallDialog::HandleReportAbuse() {
« 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