Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Side by Side Diff: chrome/browser/about_flags.cc

Issue 2146903002: Clean-up the code for default variations in chrome://flags. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iOS test crash fix? #2 Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/flags_ui/feature_entry.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/about_flags.h" 5 #include "chrome/browser/about_flags.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 {IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, switches::kNtpSwitchToExistingTab, 506 {IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, switches::kNtpSwitchToExistingTab,
507 "disabled"}, 507 "disabled"},
508 {IDS_FLAGS_NTP_SWITCH_TO_EXISTING_TAB_MATCH_URL, 508 {IDS_FLAGS_NTP_SWITCH_TO_EXISTING_TAB_MATCH_URL,
509 switches::kNtpSwitchToExistingTab, "url"}, 509 switches::kNtpSwitchToExistingTab, "url"},
510 {IDS_FLAGS_NTP_SWITCH_TO_EXISTING_TAB_MATCH_HOST, 510 {IDS_FLAGS_NTP_SWITCH_TO_EXISTING_TAB_MATCH_HOST,
511 switches::kNtpSwitchToExistingTab, "host"}, 511 switches::kNtpSwitchToExistingTab, "host"},
512 }; 512 };
513 #endif // defined(OS_ANDROID) 513 #endif // defined(OS_ANDROID)
514 514
515 #if defined(OS_ANDROID) 515 #if defined(OS_ANDROID)
516 const FeatureEntry::FeatureParam kNTPSnippetsFeatureVariationDefault[] = {};
517 const FeatureEntry::FeatureParam kNTPSnippetsFeatureVariationOnlyPersonal[] = { 516 const FeatureEntry::FeatureParam kNTPSnippetsFeatureVariationOnlyPersonal[] = {
518 {"fetching_personalization", "personal"}, 517 {"fetching_personalization", "personal"},
519 {"fetching_host_restrict", "off"}, 518 {"fetching_host_restrict", "off"},
520 }; 519 };
521 const FeatureEntry::FeatureParam 520 const FeatureEntry::FeatureParam
522 kNTPSnippetsFeatureVariationOnlyNonPersonalHostRestricted[] = { 521 kNTPSnippetsFeatureVariationOnlyNonPersonalHostRestricted[] = {
523 {"fetching_personalization", "non_personal"}, 522 {"fetching_personalization", "non_personal"},
524 {"fetching_host_restrict", "on"}, 523 {"fetching_host_restrict", "on"},
525 }; 524 };
526 const FeatureEntry::FeatureParam 525 const FeatureEntry::FeatureParam
527 kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted[] = { 526 kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted[] = {
528 {"fetching_personalization", "personal"}, 527 {"fetching_personalization", "personal"},
529 {"fetching_host_restrict", "on"}, 528 {"fetching_host_restrict", "on"},
530 }; 529 };
531 530
532 // TODO(jkrcal) allow for nullptr instead of the empty array.
533 const FeatureEntry::FeatureVariation kNTPSnippetsFeatureVariations[] = { 531 const FeatureEntry::FeatureVariation kNTPSnippetsFeatureVariations[] = {
534 {"", kNTPSnippetsFeatureVariationDefault,
535 0},
536 {"only personalized", kNTPSnippetsFeatureVariationOnlyPersonal, 532 {"only personalized", kNTPSnippetsFeatureVariationOnlyPersonal,
537 arraysize(kNTPSnippetsFeatureVariationOnlyPersonal)}, 533 arraysize(kNTPSnippetsFeatureVariationOnlyPersonal)},
538 {"only from most visited sites", 534 {"only from most visited sites",
539 kNTPSnippetsFeatureVariationOnlyNonPersonalHostRestricted, 535 kNTPSnippetsFeatureVariationOnlyNonPersonalHostRestricted,
540 arraysize(kNTPSnippetsFeatureVariationOnlyPersonal)}, 536 arraysize(kNTPSnippetsFeatureVariationOnlyPersonal)},
541 {"only personalized from most visited sites", 537 {"only personalized from most visited sites",
542 kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted, 538 kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted,
543 arraysize(kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted)}, 539 arraysize(kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted)},
544 }; 540 };
545 #endif // defined(OS_ANDROID) 541 #endif // defined(OS_ANDROID)
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
2163 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; 2159 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2164 2160
2165 const FeatureEntry* GetFeatureEntries(size_t* count) { 2161 const FeatureEntry* GetFeatureEntries(size_t* count) {
2166 *count = arraysize(kFeatureEntries); 2162 *count = arraysize(kFeatureEntries);
2167 return kFeatureEntries; 2163 return kFeatureEntries;
2168 } 2164 }
2169 2165
2170 } // namespace testing 2166 } // namespace testing
2171 2167
2172 } // namespace about_flags 2168 } // namespace about_flags
OLDNEW
« no previous file with comments | « no previous file | components/flags_ui/feature_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698