Commit e0d88767 authored by Cathy Li's avatar Cathy Li Committed by Commit Bot

[Offline pages]: Add dino page experiment flag

Change-Id: I11e64d59194d6dbb52dd0b6f3ff2fefa8f796608
Reviewed-on: https://chromium-review.googlesource.com/999010Reviewed-by: default avatarPeter Williamson <petewil@chromium.org>
Commit-Queue: Cathy Li <chili@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550091}
parent 05e262bf
......@@ -2357,6 +2357,12 @@ const FeatureEntry kFeatureEntries[] = {
kOsAndroid,
FEATURE_VALUE_TYPE(
offline_pages::kOfflinePagesInDownloadHomeOpenInCctFeature)},
{"offline-pages-alternate-dino-page",
flag_descriptions::kOfflinePagesShowAlternateDinoPageName,
flag_descriptions::kOfflinePagesShowAlternateDinoPageDescription,
kOsAndroid,
FEATURE_VALUE_TYPE(
offline_pages::kOfflinePagesShowAlternateDinoPageFeature)},
#endif // OS_ANDROID
{"disallow-doc-written-script-loads",
flag_descriptions::kDisallowDocWrittenScriptsUiName,
......
......@@ -2249,6 +2249,12 @@ const char kOfflinePagesSharingName[] = "Enables offline pages to be shared.";
const char kOfflinePagesSharingDescription[] =
"Enables the saved offline pages to be shared via other applications.";
const char kOfflinePagesShowAlternateDinoPageName[] =
"Enable alternate dino page with more user capabilities.";
const char kOfflinePagesShowAlternateDinoPageDescription[] =
"Enables the dino page to show more buttons and offer existing offline "
"content.";
const char kOfflinePagesSvelteConcurrentLoadingName[] =
"Enables concurrent background loading on svelte.";
const char kOfflinePagesSvelteConcurrentLoadingDescription[] =
......
......@@ -1364,6 +1364,9 @@ extern const char kOfflinePagesRenovationsDescription[];
extern const char kOfflinePagesSharingName[];
extern const char kOfflinePagesSharingDescription[];
extern const char kOfflinePagesShowAlternateDinoPageName[];
extern const char kOfflinePagesShowAlternateDinoPageDescription[];
extern const char kOfflinePagesSvelteConcurrentLoadingName[];
extern const char kOfflinePagesSvelteConcurrentLoadingDescription[];
......
......@@ -72,6 +72,9 @@ const base::Feature kOfflinePagesInDownloadHomeOpenInCctFeature{
const base::Feature kOfflinePagesCTSuppressNotificationsFeature{
"OfflinePagesCTSuppressNotifications", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kOfflinePagesShowAlternateDinoPageFeature{
"OfflinePagesShowAlternateDinoPage", base::FEATURE_DISABLED_BY_DEFAULT};
const char kPrefetchingOfflinePagesExperimentsOption[] = "exp";
bool IsOfflineBookmarksEnabled() {
......@@ -155,6 +158,11 @@ bool IsOfflinePagesSuppressNotificationsEnabled() {
kOfflinePagesCTSuppressNotificationsFeature);
}
bool ShouldShowAlternateDinoPage() {
return base::FeatureList::IsEnabled(
kOfflinePagesShowAlternateDinoPageFeature);
}
std::string GetPrefetchingOfflinePagesExperimentTag() {
return base::GetFieldTrialParamValueByFeature(
kPrefetchingOfflinePagesFeature,
......
......@@ -27,6 +27,7 @@ extern const base::Feature kOfflinePagesDescriptivePendingStatusFeature;
extern const base::Feature kOfflinePagesInDownloadHomeOpenInCctFeature;
extern const base::Feature kOfflinePagesDescriptiveFailStatusFeature;
extern const base::Feature kOfflinePagesCTSuppressNotificationsFeature;
extern const base::Feature kOfflinePagesShowAlternateDinoPageFeature;
// The parameter name used to find the experiment tag for prefetching offline
// pages.
......@@ -96,6 +97,9 @@ bool ShouldOfflinePagesInDownloadHomeOpenInCct();
// tabs downloads.
bool IsOfflinePagesSuppressNotificationsEnabled();
// Controls whether we should show a dinosaur page with alternate UI.
bool ShouldShowAlternateDinoPage();
// Returns an experiment tag provided by the field trial. This experiment tag
// will be included in a custom header in all requests sent to Offline Prefetch
// Server. The server will use this this optional tag to decide how to process
......
......@@ -146,4 +146,15 @@ TEST(OfflinePageFeatureTest, OfflinePagesDescriptivePendingStatus) {
EXPECT_TRUE(offline_pages::IsOfflinePagesDescriptivePendingStatusEnabled());
}
TEST(OfflinePageFeatureTest, AlternateDinoPage) {
// Disabled by default.
EXPECT_FALSE(offline_pages::ShouldShowAlternateDinoPage());
// Check if helper method works correctly when the features is enabled.
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(
kOfflinePagesShowAlternateDinoPageFeature);
EXPECT_TRUE(offline_pages::ShouldShowAlternateDinoPage());
}
} // namespace offline_pages
......@@ -26333,6 +26333,7 @@ from previous Chrome versions.
<int value="-1314603238" label="ChromeHomePullToRefreshIphAtTop:enabled"/>
<int value="-1311133348" label="VrBrowsingNativeAndroidUi:enabled"/>
<int value="-1310737697" label="MaterialDesignSettings:enabled"/>
<int value="-1304957199" label="OfflinePagesShowAlternateDinoPage:enabled"/>
<int value="-1302904242" label="enable-navigation-tracing"/>
<int value="-1302859198" label="enable-stylus-virtual-keyboard:disabled"/>
<int value="-1294050129" label="ContentFullscreen:disabled"/>
......@@ -27296,6 +27297,7 @@ from previous Chrome versions.
<int value="1036068554" label="enable-android-pay-integration-v2"/>
<int value="1043334401" label="disable-slimming-paint-invalidation"/>
<int value="1046878091" label="PasswordForceSaving:enabled"/>
<int value="1046981538" label="OfflinePagesShowAlternateDinoPage:disabled"/>
<int value="1049885154" label="OfflinePagesPrefetching:disabled"/>
<int value="1050048304" label="enable-font-cache-scaling"/>
<int value="1050321458" label="new-profile-management"/>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment