Roll src/third_party/WebKit f298044:aa8346d (svn 202628:202629)
[chromium-blink-merge.git] / chrome / browser / safe_browsing / srt_field_trial_win.cc
blobab82374921df2ce301eccd08fb95a290b1710f82
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/safe_browsing/srt_field_trial_win.h"
7 #include "base/metrics/field_trial.h"
8 #include "base/metrics/histogram.h"
9 #include "components/variations/variations_associated_data.h"
11 namespace {
13 // Field trial strings.
14 const char kSRTPromptTrial[] = "SRTPromptFieldTrial";
15 const char kSRTCanaryGroup[] = "SRTCanary";
16 const char kSRTPromptOffGroup[] = "Off";
17 const char kSRTPromptSeedParam[] = "Seed";
19 const char kSRTElevationTrial[] = "SRTElevation";
20 const char kSRTElevationAsNeededGroup[] = "AsNeeded";
22 // The download links of the Software Removal Tool.
23 const char kMainSRTDownloadURL[] =
24 "http://dl.google.com/dl"
25 "/softwareremovaltool/win/chrome_cleanup_tool.exe?chrome-prompt=1";
26 const char kCanarySRTDownloadURL[] =
27 "http://dl.google.com/dl"
28 "/softwareremovaltool/win/c/chrome_cleanup_tool.exe?chrome-prompt=1";
30 } // namespace
32 namespace safe_browsing {
34 bool IsInSRTPromptFieldTrialGroups() {
35 return base::FieldTrialList::FindFullName(kSRTPromptTrial) !=
36 kSRTPromptOffGroup;
39 bool SRTPromptNeedsElevationIcon() {
40 return base::FieldTrialList::FindFullName(kSRTElevationTrial) !=
41 kSRTElevationAsNeededGroup;
44 const char* GetSRTDownloadURL() {
45 if (base::FieldTrialList::FindFullName(kSRTPromptTrial) == kSRTCanaryGroup)
46 return kCanarySRTDownloadURL;
47 return kMainSRTDownloadURL;
50 std::string GetIncomingSRTSeed() {
51 return variations::GetVariationParamValue(kSRTPromptTrial,
52 kSRTPromptSeedParam);
55 void RecordSRTPromptHistogram(SRTPromptHistogramValue value) {
56 UMA_HISTOGRAM_ENUMERATION("SoftwareReporter.PromptUsage", value,
57 SRT_PROMPT_MAX);
60 void RecordReporterStepHistogram(SwReporterUmaValue value) {
61 UMA_HISTOGRAM_ENUMERATION("SoftwareReporter.Step", value, SW_REPORTER_MAX);
64 } // namespace safe_browsing