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

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

Issue 2182553002: Add other variations (with ids) for NTPSnippets to chrome://flags (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Alexei's comment #5 + fix a bug Created 4 years, 4 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 | « chrome/browser/about_flags.h ('k') | chrome/browser/chrome_browser_main.cc » ('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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 kNTPSnippetsFeatureVariationOnlyNonPersonalHostRestricted[] = { 550 kNTPSnippetsFeatureVariationOnlyNonPersonalHostRestricted[] = {
551 {"fetching_personalization", "non_personal"}, 551 {"fetching_personalization", "non_personal"},
552 {"fetching_host_restrict", "on"}, 552 {"fetching_host_restrict", "on"},
553 }; 553 };
554 const FeatureEntry::FeatureParam 554 const FeatureEntry::FeatureParam
555 kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted[] = { 555 kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted[] = {
556 {"fetching_personalization", "personal"}, 556 {"fetching_personalization", "personal"},
557 {"fetching_host_restrict", "on"}, 557 {"fetching_host_restrict", "on"},
558 }; 558 };
559 559
560 const FeatureEntry::FeatureParam kNTPSnippetsFeatureVariationServer[] = {
561 {"content_suggestions_backend",
562 "https://dev-chromecontentsuggestions-pa.sandbox.googleapis.com/v1/"
563 "snippets/list"}};
564
565 const FeatureEntry::FeatureParam
566 kNTPSnippetsFeatureVariationServerNonPersonalized[] = {
567 {"content_suggestions_backend",
568 "https://dev-chromecontentsuggestions-pa.sandbox.googleapis.com/v1/"
569 "snippets/list"},
570 {"fetching_personalization", "non_personal"}};
571
560 const FeatureEntry::FeatureVariation kNTPSnippetsFeatureVariations[] = { 572 const FeatureEntry::FeatureVariation kNTPSnippetsFeatureVariations[] = {
561 {"only personalized", kNTPSnippetsFeatureVariationOnlyPersonal, 573 {"via ChromeReader (only personalized)",
562 arraysize(kNTPSnippetsFeatureVariationOnlyPersonal)}, 574 kNTPSnippetsFeatureVariationOnlyPersonal,
563 {"only from most visited sites", 575 arraysize(kNTPSnippetsFeatureVariationOnlyPersonal), nullptr},
576 {"via ChromeReader (only from most visited sites)",
564 kNTPSnippetsFeatureVariationOnlyNonPersonalHostRestricted, 577 kNTPSnippetsFeatureVariationOnlyNonPersonalHostRestricted,
565 arraysize(kNTPSnippetsFeatureVariationOnlyPersonal)}, 578 arraysize(kNTPSnippetsFeatureVariationOnlyPersonal), nullptr},
566 {"only personalized from most visited sites", 579 {"via ChromeReader (only personalized from most visited sites)",
567 kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted, 580 kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted,
568 arraysize(kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted)}, 581 arraysize(kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted),
569 }; 582 nullptr},
583 {"via content suggestion server (backed by ChromeReader)",
584 kNTPSnippetsFeatureVariationServer,
585 arraysize(kNTPSnippetsFeatureVariationServer), nullptr},
586 {"via content suggestion server (backed by ChromeReader, non-personalized)",
587 kNTPSnippetsFeatureVariationServerNonPersonalized,
588 arraysize(kNTPSnippetsFeatureVariationServerNonPersonalized), nullptr},
589 {"via content suggestion server (backed by Google Now)",
590 kNTPSnippetsFeatureVariationServer,
591 arraysize(kNTPSnippetsFeatureVariationServer), "3313279"},
592 {"via content suggestion server (backed by Google Now, non-personalized)",
593 kNTPSnippetsFeatureVariationServerNonPersonalized,
594 arraysize(kNTPSnippetsFeatureVariationServerNonPersonalized), "3313279"}};
570 #endif // defined(OS_ANDROID) 595 #endif // defined(OS_ANDROID)
571 596
572 #if defined(OS_ANDROID) 597 #if defined(OS_ANDROID)
573 const FeatureEntry::Choice kUpdateMenuItemSummaryChoices[] = { 598 const FeatureEntry::Choice kUpdateMenuItemSummaryChoices[] = {
574 {IDS_FLAGS_UPDATE_MENU_ITEM_NO_SUMMARY, "", ""}, 599 {IDS_FLAGS_UPDATE_MENU_ITEM_NO_SUMMARY, "", ""},
575 {IDS_FLAGS_UPDATE_MENU_ITEM_DEFAULT_SUMMARY, 600 {IDS_FLAGS_UPDATE_MENU_ITEM_DEFAULT_SUMMARY,
576 switches::kForceShowUpdateMenuItemSummary, ""}, 601 switches::kForceShowUpdateMenuItemSummary, ""},
577 {IDS_FLAGS_UPDATE_MENU_ITEM_NEW_FEATURES_SUMMARY, 602 {IDS_FLAGS_UPDATE_MENU_ITEM_NEW_FEATURES_SUMMARY,
578 switches::kForceShowUpdateMenuItemNewFeaturesSummary, ""}, 603 switches::kForceShowUpdateMenuItemNewFeaturesSummary, ""},
579 {IDS_FLAGS_UPDATE_MENU_ITEM_CUSTOM_SUMMARY, 604 {IDS_FLAGS_UPDATE_MENU_ITEM_CUSTOM_SUMMARY,
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
2099 base::CommandLine* command_line, 2124 base::CommandLine* command_line,
2100 flags_ui::SentinelsMode sentinels) { 2125 flags_ui::SentinelsMode sentinels) {
2101 if (command_line->HasSwitch(switches::kNoExperiments)) 2126 if (command_line->HasSwitch(switches::kNoExperiments))
2102 return; 2127 return;
2103 2128
2104 FlagsStateSingleton::GetFlagsState()->ConvertFlagsToSwitches( 2129 FlagsStateSingleton::GetFlagsState()->ConvertFlagsToSwitches(
2105 flags_storage, command_line, sentinels, switches::kEnableFeatures, 2130 flags_storage, command_line, sentinels, switches::kEnableFeatures,
2106 switches::kDisableFeatures); 2131 switches::kDisableFeatures);
2107 } 2132 }
2108 2133
2109 void RegisterAllFeatureVariationParameters( 2134 std::vector<std::string> RegisterAllFeatureVariationParameters(
2110 flags_ui::FlagsStorage* flags_storage, 2135 flags_ui::FlagsStorage* flags_storage,
2111 base::FeatureList* feature_list) { 2136 base::FeatureList* feature_list) {
2112 FlagsStateSingleton::GetFlagsState()->RegisterAllFeatureVariationParameters( 2137 return FlagsStateSingleton::GetFlagsState()
2113 flags_storage, feature_list); 2138 ->RegisterAllFeatureVariationParameters(flags_storage, feature_list);
2114 } 2139 }
2115 2140
2116 bool AreSwitchesIdenticalToCurrentCommandLine( 2141 bool AreSwitchesIdenticalToCurrentCommandLine(
2117 const base::CommandLine& new_cmdline, 2142 const base::CommandLine& new_cmdline,
2118 const base::CommandLine& active_cmdline, 2143 const base::CommandLine& active_cmdline,
2119 std::set<base::CommandLine::StringType>* out_difference) { 2144 std::set<base::CommandLine::StringType>* out_difference) {
2120 const char* extra_flag_sentinel_begin_flag_name = nullptr; 2145 const char* extra_flag_sentinel_begin_flag_name = nullptr;
2121 const char* extra_flag_sentinel_end_flag_name = nullptr; 2146 const char* extra_flag_sentinel_end_flag_name = nullptr;
2122 #if defined(OS_CHROMEOS) 2147 #if defined(OS_CHROMEOS)
2123 // Put the flags between --policy-switches--begin and --policy-switches-end on 2148 // Put the flags between --policy-switches--begin and --policy-switches-end on
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
2211 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; 2236 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2212 2237
2213 const FeatureEntry* GetFeatureEntries(size_t* count) { 2238 const FeatureEntry* GetFeatureEntries(size_t* count) {
2214 *count = arraysize(kFeatureEntries); 2239 *count = arraysize(kFeatureEntries);
2215 return kFeatureEntries; 2240 return kFeatureEntries;
2216 } 2241 }
2217 2242
2218 } // namespace testing 2243 } // namespace testing
2219 2244
2220 } // namespace about_flags 2245 } // namespace about_flags
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.h ('k') | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698