summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/send_feedback_experiment.cc
blob: bc13f3f185ff92ae74ea7bae5af8549b723b811e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/send_feedback_experiment.h"

#include "base/metrics/field_trial.h"
#include "grit/generated_resources.h"

namespace chrome {

// Constants for Send Feedback Link Location Experiment
const char kSendFeedbackLinkExperimentName[] =
    "SendFeedbackLinkLocation";
const char kSendFeedbackLinkExperimentAltText[] = "alt-text";
const char kSendFeedbackLinkExperimentAltLocation[] = "alt-location";
const char kSendFeedbackLinkExperimentAltTextAndLocation[] =
    "alt-text-and-location";

bool UseAlternateSendFeedbackText() {
  std::string trial_name =
      base::FieldTrialList::FindFullName(kSendFeedbackLinkExperimentName);
  return trial_name == kSendFeedbackLinkExperimentAltText ||
         trial_name == kSendFeedbackLinkExperimentAltTextAndLocation;
}

bool UseAlternateSendFeedbackLocation() {
  std::string trial_name =
      base::FieldTrialList::FindFullName(kSendFeedbackLinkExperimentName);
  return trial_name == kSendFeedbackLinkExperimentAltLocation ||
         trial_name == kSendFeedbackLinkExperimentAltTextAndLocation;
}

int GetSendFeedbackMenuLabelID() {
  return UseAlternateSendFeedbackText() ? IDS_FEEDBACK_ALT : IDS_FEEDBACK;
}

}  // namespace chrome