Chromium Code Reviews| Index: components/flags_ui/feature_entry.cc |
| diff --git a/components/flags_ui/feature_entry.cc b/components/flags_ui/feature_entry.cc |
| index 53a219c3d55c59d51ca41be641e86eec610b9aa6..47cf080a0f0b4c824da5c0d1ec8ccbfc5a01b9f5 100644 |
| --- a/components/flags_ui/feature_entry.cc |
| +++ b/components/flags_ui/feature_entry.cc |
| @@ -41,11 +41,10 @@ base::string16 FeatureEntry::DescriptionForOption(int index) const { |
| if (index == 0) { |
| description_id = IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT; |
| } else if (index == 1) { |
| - // Variation 1: the default enabled variation => "Enabled". |
| description_id = IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED; |
| } else if (index < num_options - 1) { |
| - // Variations 2 .. n => "Enabled <description_text>". |
| - int variation_index = index - 1; |
| + // First two options do not correspond to variations. |
|
Alexei Svitkine (slow)
2016/07/13 14:07:13
Nit: I would actually rephrase this slightly, i.e.
|
| + int variation_index = index - 2; |
| return l10n_util::GetStringUTF16(IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED) + |
| base::ASCIIToUTF16(" ") + |
| base::ASCIIToUTF16( |
| @@ -86,11 +85,12 @@ const FeatureEntry::FeatureVariation* FeatureEntry::VariationForOption( |
| type == FeatureEntry::FEATURE_WITH_VARIATIONS_VALUE); |
| DCHECK_LT(index, num_options); |
| - if (type == FeatureEntry::FEATURE_WITH_VARIATIONS_VALUE && index > 0 && |
| + if (type == FeatureEntry::FEATURE_WITH_VARIATIONS_VALUE && index > 1 && |
| index < num_options - 1) { |
| // We have no variations for FEATURE_VALUE type. Option at |index| |
| - // corresponds to variation at |index| - 1 as the first option is "Default". |
| - return &feature_variations[index - 1]; |
| + // corresponds to variation at |index| - 2 as the list starts with "Default" |
| + // and "Enabled" (with default parameters). |
| + return &feature_variations[index - 2]; |
| } |
| return nullptr; |
| } |