OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 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. |
| 4 |
| 5 #include "chrome/browser/ui/send_feedback_experiment.h" |
| 6 |
| 7 #include "base/metrics/field_trial.h" |
| 8 #include "grit/generated_resources.h" |
| 9 |
| 10 namespace chrome { |
| 11 |
| 12 // Constants for Send Feedback Link Location Experiment |
| 13 const char kSendFeedbackLinkExperimentName[] = |
| 14 "SendFeedbackLinkLocation"; |
| 15 const char kSendFeedbackLinkExperimentAltText[] = "alt-text"; |
| 16 const char kSendFeedbackLinkExperimentAltLocation[] = "alt-location"; |
| 17 const char kSendFeedbackLinkExperimentAltTextAndLocation[] = |
| 18 "alt-text-and-location"; |
| 19 |
| 20 bool UseAlternateSendFeedbackText() { |
| 21 std::string trial_name = |
| 22 base::FieldTrialList::FindFullName(kSendFeedbackLinkExperimentName); |
| 23 return trial_name == kSendFeedbackLinkExperimentAltText || |
| 24 trial_name == kSendFeedbackLinkExperimentAltTextAndLocation; |
| 25 } |
| 26 |
| 27 bool UseAlternateSendFeedbackLocation() { |
| 28 std::string trial_name = |
| 29 base::FieldTrialList::FindFullName(kSendFeedbackLinkExperimentName); |
| 30 return trial_name == kSendFeedbackLinkExperimentAltLocation || |
| 31 trial_name == kSendFeedbackLinkExperimentAltTextAndLocation; |
| 32 } |
| 33 |
| 34 int GetSendFeedbackMenuLabelID() { |
| 35 return UseAlternateSendFeedbackText() ? IDS_FEEDBACK_ALT : IDS_FEEDBACK; |
| 36 } |
| 37 |
| 38 } // namespace chrome |
OLD | NEW |