Chromium Code Reviews| 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 { | |
|
SteveT
2013/03/19 14:38:58
nit: I believe there should be an extra line break
Harry McCleave
2013/03/19 22:23:29
Done.
| |
| 11 namespace send_feedback_experiment { | |
| 12 | |
| 13 // Constants for Send Feedback Link Location Experiment | |
| 14 const char kSendFeedbackLinkExperimentName[] = | |
| 15 "SendFeedbackLinkLocation"; | |
| 16 const char kSendFeedbackLinkExperimentAltText[] = "alt-text"; | |
| 17 const char kSendFeedbackLinkExperimentAltLocation[] = "alt-location"; | |
| 18 const char kSendFeedbackLinkExperimentAltTextAndLocation[] = | |
| 19 "alt-text-and-location"; | |
| 20 | |
| 21 bool UseAlternateText() { | |
| 22 return base::FieldTrialList::TrialExists(kSendFeedbackLinkExperimentName) && | |
| 23 (base::FieldTrialList::FindFullName(kSendFeedbackLinkExperimentName) == | |
| 24 kSendFeedbackLinkExperimentAltText || | |
| 25 base::FieldTrialList::FindFullName(kSendFeedbackLinkExperimentName) == | |
| 26 kSendFeedbackLinkExperimentAltTextAndLocation); | |
|
SteveT
2013/03/19 14:38:58
You don't need to call TrialExists. FindFullName w
Harry McCleave
2013/03/19 22:23:29
Done.
| |
| 27 } | |
| 28 | |
| 29 bool UseAlternateLocation() { | |
| 30 return base::FieldTrialList::TrialExists(kSendFeedbackLinkExperimentName) && | |
| 31 (base::FieldTrialList::FindFullName(kSendFeedbackLinkExperimentName) == | |
| 32 kSendFeedbackLinkExperimentAltLocation || | |
| 33 base::FieldTrialList::FindFullName(kSendFeedbackLinkExperimentName) == | |
| 34 kSendFeedbackLinkExperimentAltTextAndLocation); | |
|
SteveT
2013/03/19 14:38:58
Some requests as above :)
Harry McCleave
2013/03/19 22:23:29
Done.
| |
| 35 } | |
| 36 | |
| 37 int GetMenuLabelID() { | |
| 38 return UseAlternateText() ? IDS_FEEDBACK_ALT : IDS_FEEDBACK; | |
|
SteveT
2013/03/19 14:38:58
Question: Is UseAlternateText called anywhere but
Harry McCleave
2013/03/19 22:23:29
Yes, GetMenuLabelID is used for menu items, the Al
| |
| 39 } | |
| 40 | |
| 41 } // send_feedback_experiment | |
|
SteveT
2013/03/19 14:38:58
nit: I believe there should be an extra line break
Harry McCleave
2013/03/19 22:23:29
Done.
| |
| 42 } // chrome | |
|
SteveT
2013/03/19 14:38:58
nit: "// namespace chrome"
Harry McCleave
2013/03/19 22:23:29
Done.
| |
| OLD | NEW |