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

Unified Diff: chrome/browser/about_flags.cc

Issue 2041783002: Preset variation parameters for NTPSnippets feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@about-flags-parameters
Patch Set: Removing unittests that test non-default behaviour Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/about_flags.cc
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 075118b733f851fe339d8dc357481d9c5ddb311b..5d05a5f558af075c070c379211faad3a39a4f1ef 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -44,6 +44,7 @@
#include "components/flags_ui/flags_ui_switches.h"
#include "components/nacl/common/nacl_switches.h"
#include "components/network_session_configurator/switches.h"
+#include "components/ntp_snippets/ntp_snippets_constants.h"
#include "components/ntp_tiles/switches.h"
#include "components/offline_pages/offline_page_feature.h"
#include "components/omnibox/browser/omnibox_switches.h"
@@ -512,6 +513,38 @@ const FeatureEntry::Choice kNtpSwitchToExistingTabChoices[] = {
#endif // defined(OS_ANDROID)
#if defined(OS_ANDROID)
+const FeatureEntry::FeatureParam kNTPSnippetsFeatureVariationDefault[] = {};
+const FeatureEntry::FeatureParam kNTPSnippetsFeatureVariationOnlyPersonal[] = {
+ {"fetching_personalization", "personal"},
+ {"fetching_host_restrict", "off"},
+};
+const FeatureEntry::FeatureParam
+ kNTPSnippetsFeatureVariationOnlyNonPersonalHostRestricted[] = {
+ {"fetching_personalization", "non_personal"},
+ {"fetching_host_restrict", "on"},
+};
+const FeatureEntry::FeatureParam
+ kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted[] = {
+ {"fetching_personalization", "personal"},
+ {"fetching_host_restrict", "on"},
+};
+
+// TODO(jkrcal) allow for nullptr instead of the empty array.
+const FeatureEntry::FeatureVariation kNTPSnippetsFeatureVariations[] = {
+ {"", kNTPSnippetsFeatureVariationDefault,
+ 0},
+ {"only personalized", kNTPSnippetsFeatureVariationOnlyPersonal,
+ arraysize(kNTPSnippetsFeatureVariationOnlyPersonal)},
+ {"only from most visited sites",
+ kNTPSnippetsFeatureVariationOnlyNonPersonalHostRestricted,
+ arraysize(kNTPSnippetsFeatureVariationOnlyPersonal)},
+ {"only personalized from most visited sites",
+ kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted,
+ arraysize(kNTPSnippetsFeatureVariationOnlyPersonalHostRestricted)},
+};
+#endif // defined(OS_ANDROID)
+
+#if defined(OS_ANDROID)
const FeatureEntry::Choice kUpdateMenuItemSummaryChoices[] = {
{IDS_FLAGS_UPDATE_MENU_ITEM_NO_SUMMARY, "", ""},
{IDS_FLAGS_UPDATE_MENU_ITEM_DEFAULT_SUMMARY,
@@ -1811,7 +1844,9 @@ const FeatureEntry kFeatureEntries[] = {
#if defined(OS_ANDROID)
{"enable-ntp-snippets", IDS_FLAGS_ENABLE_NTP_SNIPPETS_NAME,
IDS_FLAGS_ENABLE_NTP_SNIPPETS_DESCRIPTION, kOsAndroid,
- FEATURE_VALUE_TYPE(chrome::android::kNTPSnippetsFeature)},
+ FEATURE_WITH_VARIATIONS_VALUE_TYPE(chrome::android::kNTPSnippetsFeature,
+ kNTPSnippetsFeatureVariations,
+ ntp_snippets::kStudyName)},
#endif // defined(OS_ANDROID)
#if defined(ENABLE_WEBRTC) && BUILDFLAG(RTC_USE_H264)
{"enable-webrtc-h264-with-openh264-ffmpeg",
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698