Index: chrome/browser/ui/send_feedback_experiment.cc |
diff --git a/chrome/browser/ui/send_feedback_experiment.cc b/chrome/browser/ui/send_feedback_experiment.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d9e83d640a2b911a5e4d78b7e5007d041b61d07c |
--- /dev/null |
+++ b/chrome/browser/ui/send_feedback_experiment.cc |
@@ -0,0 +1,42 @@ |
+// 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 { |
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.
|
+namespace send_feedback_experiment { |
+ |
+// 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 UseAlternateText() { |
+ return base::FieldTrialList::TrialExists(kSendFeedbackLinkExperimentName) && |
+ (base::FieldTrialList::FindFullName(kSendFeedbackLinkExperimentName) == |
+ kSendFeedbackLinkExperimentAltText || |
+ base::FieldTrialList::FindFullName(kSendFeedbackLinkExperimentName) == |
+ 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.
|
+} |
+ |
+bool UseAlternateLocation() { |
+ return base::FieldTrialList::TrialExists(kSendFeedbackLinkExperimentName) && |
+ (base::FieldTrialList::FindFullName(kSendFeedbackLinkExperimentName) == |
+ kSendFeedbackLinkExperimentAltLocation || |
+ base::FieldTrialList::FindFullName(kSendFeedbackLinkExperimentName) == |
+ kSendFeedbackLinkExperimentAltTextAndLocation); |
SteveT
2013/03/19 14:38:58
Some requests as above :)
Harry McCleave
2013/03/19 22:23:29
Done.
|
+} |
+ |
+int GetMenuLabelID() { |
+ 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
|
+} |
+ |
+} // 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.
|
+} // chrome |
SteveT
2013/03/19 14:38:58
nit: "// namespace chrome"
Harry McCleave
2013/03/19 22:23:29
Done.
|