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 namespace send_feedback_experiment { |
| 13 |
| 14 // Constants for Send Feedback Link Location Experiment |
| 15 const char kSendFeedbackLinkExperimentName[] = |
| 16 "SendFeedbackLinkLocation"; |
| 17 const char kSendFeedbackLinkExperimentAltText[] = "alt-text"; |
| 18 const char kSendFeedbackLinkExperimentAltLocation[] = "alt-location"; |
| 19 const char kSendFeedbackLinkExperimentAltTextAndLocation[] = |
| 20 "alt-text-and-location"; |
| 21 |
| 22 bool UseAlternateText() { |
| 23 std::string trial_name = |
| 24 base::FieldTrialList::FindFullName(kSendFeedbackLinkExperimentName); |
| 25 return trial_name == kSendFeedbackLinkExperimentAltText || |
| 26 trial_name == kSendFeedbackLinkExperimentAltTextAndLocation; |
| 27 } |
| 28 |
| 29 bool UseAlternateLocation() { |
| 30 std::string trial_name = |
| 31 base::FieldTrialList::FindFullName(kSendFeedbackLinkExperimentName); |
| 32 return trial_name == kSendFeedbackLinkExperimentAltLocation || |
| 33 trial_name == kSendFeedbackLinkExperimentAltTextAndLocation; |
| 34 } |
| 35 |
| 36 int GetMenuLabelID() { |
| 37 return UseAlternateText() ? IDS_FEEDBACK_ALT : IDS_FEEDBACK; |
| 38 } |
| 39 |
| 40 } // namespace send_feedback_experiment |
| 41 |
| 42 } // namespace chrome |
OLD | NEW |