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

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: Remove an empty line (added by mistake) 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
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), ""},
576 {"via ChromeReader (only from most visited sites)",
564 kNTPSnippetsFeatureVariationOnlyNonPersonalHostRestricted, 577 kNTPSnippetsFeatureVariationOnlyNonPersonalHostRestricted,
565 arraysize(kNTPSnippetsFeatureVariationOnlyPersonal)}, 578 arraysize(kNTPSnippetsFeatureVariationOnlyPersonal), ""},
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 {"via content suggestion server (backed by ChromeReader)",
583 kNTPSnippetsFeatureVariationServer,
584 arraysize(kNTPSnippetsFeatureVariationServer), ""},
585 {"via content suggestion server (backed by ChromeReader, non-personalized)",
586 kNTPSnippetsFeatureVariationServerNonPersonalized,
587 arraysize(kNTPSnippetsFeatureVariationServerNonPersonalized), ""},
588 {"via content suggestion server (backed by Google Now)",
589 kNTPSnippetsFeatureVariationServer,
590 arraysize(kNTPSnippetsFeatureVariationServer), "3313279"},
591 {"via content suggestion server (backed by Google Now, non-personalized)",
592 kNTPSnippetsFeatureVariationServerNonPersonalized,
593 arraysize(kNTPSnippetsFeatureVariationServerNonPersonalized), "3313279"}};
570 #endif // defined(OS_ANDROID) 594 #endif // defined(OS_ANDROID)
571 595
572 #if defined(OS_ANDROID) 596 #if defined(OS_ANDROID)
573 const FeatureEntry::Choice kUpdateMenuItemSummaryChoices[] = { 597 const FeatureEntry::Choice kUpdateMenuItemSummaryChoices[] = {
574 {IDS_FLAGS_UPDATE_MENU_ITEM_NO_SUMMARY, "", ""}, 598 {IDS_FLAGS_UPDATE_MENU_ITEM_NO_SUMMARY, "", ""},
575 {IDS_FLAGS_UPDATE_MENU_ITEM_DEFAULT_SUMMARY, 599 {IDS_FLAGS_UPDATE_MENU_ITEM_DEFAULT_SUMMARY,
576 switches::kForceShowUpdateMenuItemSummary, ""}, 600 switches::kForceShowUpdateMenuItemSummary, ""},
577 {IDS_FLAGS_UPDATE_MENU_ITEM_NEW_FEATURES_SUMMARY, 601 {IDS_FLAGS_UPDATE_MENU_ITEM_NEW_FEATURES_SUMMARY,
578 switches::kForceShowUpdateMenuItemNewFeaturesSummary, ""}, 602 switches::kForceShowUpdateMenuItemNewFeaturesSummary, ""},
579 {IDS_FLAGS_UPDATE_MENU_ITEM_CUSTOM_SUMMARY, 603 {IDS_FLAGS_UPDATE_MENU_ITEM_CUSTOM_SUMMARY,
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after
2098 base::CommandLine* command_line, 2122 base::CommandLine* command_line,
2099 flags_ui::SentinelsMode sentinels) { 2123 flags_ui::SentinelsMode sentinels) {
2100 if (command_line->HasSwitch(switches::kNoExperiments)) 2124 if (command_line->HasSwitch(switches::kNoExperiments))
2101 return; 2125 return;
2102 2126
2103 FlagsStateSingleton::GetFlagsState()->ConvertFlagsToSwitches( 2127 FlagsStateSingleton::GetFlagsState()->ConvertFlagsToSwitches(
2104 flags_storage, command_line, sentinels, switches::kEnableFeatures, 2128 flags_storage, command_line, sentinels, switches::kEnableFeatures,
2105 switches::kDisableFeatures); 2129 switches::kDisableFeatures);
2106 } 2130 }
2107 2131
2108 void RegisterAllFeatureVariationParameters( 2132 std::string RegisterAllFeatureVariationParameters(
Alexei Svitkine (slow) 2016/07/25 19:15:50 Nit: Remove extra space.
jkrcal 2016/07/26 09:00:21 Done.
2109 flags_ui::FlagsStorage* flags_storage, 2133 flags_ui::FlagsStorage* flags_storage,
2110 base::FeatureList* feature_list) { 2134 base::FeatureList* feature_list) {
2111 FlagsStateSingleton::GetFlagsState()->RegisterAllFeatureVariationParameters( 2135 return FlagsStateSingleton::GetFlagsState()
2112 flags_storage, feature_list); 2136 ->RegisterAllFeatureVariationParameters(flags_storage, feature_list);
2113 } 2137 }
2114 2138
2115 bool AreSwitchesIdenticalToCurrentCommandLine( 2139 bool AreSwitchesIdenticalToCurrentCommandLine(
2116 const base::CommandLine& new_cmdline, 2140 const base::CommandLine& new_cmdline,
2117 const base::CommandLine& active_cmdline, 2141 const base::CommandLine& active_cmdline,
2118 std::set<base::CommandLine::StringType>* out_difference) { 2142 std::set<base::CommandLine::StringType>* out_difference) {
2119 const char* extra_flag_sentinel_begin_flag_name = nullptr; 2143 const char* extra_flag_sentinel_begin_flag_name = nullptr;
2120 const char* extra_flag_sentinel_end_flag_name = nullptr; 2144 const char* extra_flag_sentinel_end_flag_name = nullptr;
2121 #if defined(OS_CHROMEOS) 2145 #if defined(OS_CHROMEOS)
2122 // Put the flags between --policy-switches--begin and --policy-switches-end on 2146 // Put the flags between --policy-switches--begin and --policy-switches-end on
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; 2234 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2211 2235
2212 const FeatureEntry* GetFeatureEntries(size_t* count) { 2236 const FeatureEntry* GetFeatureEntries(size_t* count) {
2213 *count = arraysize(kFeatureEntries); 2237 *count = arraysize(kFeatureEntries);
2214 return kFeatureEntries; 2238 return kFeatureEntries;
2215 } 2239 }
2216 2240
2217 } // namespace testing 2241 } // namespace testing
2218 2242
2219 } // namespace about_flags 2243 } // namespace about_flags
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698