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[] = { ...@@ -2357,6 +2357,12 @@ const FeatureEntry kFeatureEntries[] = {
kOsAndroid, kOsAndroid,
FEATURE_VALUE_TYPE( FEATURE_VALUE_TYPE(
offline_pages::kOfflinePagesInDownloadHomeOpenInCctFeature)}, offline_pages::kOfflinePagesInDownloadHomeOpenInCctFeature)},
{"offline-pages-alternate-dino-page",
flag_descriptions::kOfflinePagesShowAlternateDinoPageName,
flag_descriptions::kOfflinePagesShowAlternateDinoPageDescription,
kOsAndroid,
FEATURE_VALUE_TYPE(
offline_pages::kOfflinePagesShowAlternateDinoPageFeature)},
#endif // OS_ANDROID #endif // OS_ANDROID
{"disallow-doc-written-script-loads", {"disallow-doc-written-script-loads",
flag_descriptions::kDisallowDocWrittenScriptsUiName, flag_descriptions::kDisallowDocWrittenScriptsUiName,
......
...@@ -2249,6 +2249,12 @@ const char kOfflinePagesSharingName[] = "Enables offline pages to be shared."; ...@@ -2249,6 +2249,12 @@ const char kOfflinePagesSharingName[] = "Enables offline pages to be shared.";
const char kOfflinePagesSharingDescription[] = const char kOfflinePagesSharingDescription[] =
"Enables the saved offline pages to be shared via other applications."; "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[] = const char kOfflinePagesSvelteConcurrentLoadingName[] =
"Enables concurrent background loading on svelte."; "Enables concurrent background loading on svelte.";
const char kOfflinePagesSvelteConcurrentLoadingDescription[] = const char kOfflinePagesSvelteConcurrentLoadingDescription[] =
......
...@@ -1364,6 +1364,9 @@ extern const char kOfflinePagesRenovationsDescription[]; ...@@ -1364,6 +1364,9 @@ extern const char kOfflinePagesRenovationsDescription[];
extern const char kOfflinePagesSharingName[]; extern const char kOfflinePagesSharingName[];
extern const char kOfflinePagesSharingDescription[]; extern const char kOfflinePagesSharingDescription[];
extern const char kOfflinePagesShowAlternateDinoPageName[];
extern const char kOfflinePagesShowAlternateDinoPageDescription[];
extern const char kOfflinePagesSvelteConcurrentLoadingName[]; extern const char kOfflinePagesSvelteConcurrentLoadingName[];
extern const char kOfflinePagesSvelteConcurrentLoadingDescription[]; extern const char kOfflinePagesSvelteConcurrentLoadingDescription[];
......
...@@ -72,6 +72,9 @@ const base::Feature kOfflinePagesInDownloadHomeOpenInCctFeature{ ...@@ -72,6 +72,9 @@ const base::Feature kOfflinePagesInDownloadHomeOpenInCctFeature{
const base::Feature kOfflinePagesCTSuppressNotificationsFeature{ const base::Feature kOfflinePagesCTSuppressNotificationsFeature{
"OfflinePagesCTSuppressNotifications", base::FEATURE_DISABLED_BY_DEFAULT}; "OfflinePagesCTSuppressNotifications", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kOfflinePagesShowAlternateDinoPageFeature{
"OfflinePagesShowAlternateDinoPage", base::FEATURE_DISABLED_BY_DEFAULT};
const char kPrefetchingOfflinePagesExperimentsOption[] = "exp"; const char kPrefetchingOfflinePagesExperimentsOption[] = "exp";
bool IsOfflineBookmarksEnabled() { bool IsOfflineBookmarksEnabled() {
...@@ -155,6 +158,11 @@ bool IsOfflinePagesSuppressNotificationsEnabled() { ...@@ -155,6 +158,11 @@ bool IsOfflinePagesSuppressNotificationsEnabled() {
kOfflinePagesCTSuppressNotificationsFeature); kOfflinePagesCTSuppressNotificationsFeature);
} }
bool ShouldShowAlternateDinoPage() {
return base::FeatureList::IsEnabled(
kOfflinePagesShowAlternateDinoPageFeature);
}
std::string GetPrefetchingOfflinePagesExperimentTag() { std::string GetPrefetchingOfflinePagesExperimentTag() {
return base::GetFieldTrialParamValueByFeature( return base::GetFieldTrialParamValueByFeature(
kPrefetchingOfflinePagesFeature, kPrefetchingOfflinePagesFeature,
......
...@@ -27,6 +27,7 @@ extern const base::Feature kOfflinePagesDescriptivePendingStatusFeature; ...@@ -27,6 +27,7 @@ extern const base::Feature kOfflinePagesDescriptivePendingStatusFeature;
extern const base::Feature kOfflinePagesInDownloadHomeOpenInCctFeature; extern const base::Feature kOfflinePagesInDownloadHomeOpenInCctFeature;
extern const base::Feature kOfflinePagesDescriptiveFailStatusFeature; extern const base::Feature kOfflinePagesDescriptiveFailStatusFeature;
extern const base::Feature kOfflinePagesCTSuppressNotificationsFeature; extern const base::Feature kOfflinePagesCTSuppressNotificationsFeature;
extern const base::Feature kOfflinePagesShowAlternateDinoPageFeature;
// The parameter name used to find the experiment tag for prefetching offline // The parameter name used to find the experiment tag for prefetching offline
// pages. // pages.
...@@ -96,6 +97,9 @@ bool ShouldOfflinePagesInDownloadHomeOpenInCct(); ...@@ -96,6 +97,9 @@ bool ShouldOfflinePagesInDownloadHomeOpenInCct();
// tabs downloads. // tabs downloads.
bool IsOfflinePagesSuppressNotificationsEnabled(); 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 // 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 // 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 // Server. The server will use this this optional tag to decide how to process
......
...@@ -146,4 +146,15 @@ TEST(OfflinePageFeatureTest, OfflinePagesDescriptivePendingStatus) { ...@@ -146,4 +146,15 @@ TEST(OfflinePageFeatureTest, OfflinePagesDescriptivePendingStatus) {
EXPECT_TRUE(offline_pages::IsOfflinePagesDescriptivePendingStatusEnabled()); 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 } // namespace offline_pages
...@@ -26333,6 +26333,7 @@ from previous Chrome versions. ...@@ -26333,6 +26333,7 @@ from previous Chrome versions.
<int value="-1314603238" label="ChromeHomePullToRefreshIphAtTop:enabled"/> <int value="-1314603238" label="ChromeHomePullToRefreshIphAtTop:enabled"/>
<int value="-1311133348" label="VrBrowsingNativeAndroidUi:enabled"/> <int value="-1311133348" label="VrBrowsingNativeAndroidUi:enabled"/>
<int value="-1310737697" label="MaterialDesignSettings:enabled"/> <int value="-1310737697" label="MaterialDesignSettings:enabled"/>
<int value="-1304957199" label="OfflinePagesShowAlternateDinoPage:enabled"/>
<int value="-1302904242" label="enable-navigation-tracing"/> <int value="-1302904242" label="enable-navigation-tracing"/>
<int value="-1302859198" label="enable-stylus-virtual-keyboard:disabled"/> <int value="-1302859198" label="enable-stylus-virtual-keyboard:disabled"/>
<int value="-1294050129" label="ContentFullscreen:disabled"/> <int value="-1294050129" label="ContentFullscreen:disabled"/>
...@@ -27296,6 +27297,7 @@ from previous Chrome versions. ...@@ -27296,6 +27297,7 @@ from previous Chrome versions.
<int value="1036068554" label="enable-android-pay-integration-v2"/> <int value="1036068554" label="enable-android-pay-integration-v2"/>
<int value="1043334401" label="disable-slimming-paint-invalidation"/> <int value="1043334401" label="disable-slimming-paint-invalidation"/>
<int value="1046878091" label="PasswordForceSaving:enabled"/> <int value="1046878091" label="PasswordForceSaving:enabled"/>
<int value="1046981538" label="OfflinePagesShowAlternateDinoPage:disabled"/>
<int value="1049885154" label="OfflinePagesPrefetching:disabled"/> <int value="1049885154" label="OfflinePagesPrefetching:disabled"/>
<int value="1050048304" label="enable-font-cache-scaling"/> <int value="1050048304" label="enable-font-cache-scaling"/>
<int value="1050321458" label="new-profile-management"/> <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