Commit 22a4d504 authored by adamta's avatar adamta Committed by Commit Bot

Feature Flag for Discover Feed in Bling NTP

Change-Id: I04d3b1315656d9adedd6871435ef0686924bb41a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2202387Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Adam Trudeau-Arcaro <adamta@google.com>
Cr-Commit-Position: refs/heads/master@{#770913}
parent 38081dc2
...@@ -952,6 +952,11 @@ ...@@ -952,6 +952,11 @@
"owners": [ "alemate" ], "owners": [ "alemate" ],
"expiry_milestone": 80 "expiry_milestone": 80
}, },
{
"name": "discover-feed-ntp-ios",
"owners": [ "adamta", "sczs" ],
"expiry_milestone": 89
},
{ {
"name": "display-change-modal", "name": "display-change-modal",
"owners": [ "baileyberro", "zentaro" ], "owners": [ "baileyberro", "zentaro" ],
......
...@@ -47,6 +47,7 @@ source_set("flags") { ...@@ -47,6 +47,7 @@ source_set("flags") {
"//ios/chrome/browser/passwords:feature_flags", "//ios/chrome/browser/passwords:feature_flags",
"//ios/chrome/browser/policy:feature_flags", "//ios/chrome/browser/policy:feature_flags",
"//ios/chrome/browser/ui:feature_flags", "//ios/chrome/browser/ui:feature_flags",
"//ios/chrome/browser/ui/content_suggestions:feature_flags",
"//ios/chrome/browser/ui/download:features", "//ios/chrome/browser/ui/download:features",
"//ios/chrome/browser/ui/fullscreen:feature_flags", "//ios/chrome/browser/ui/fullscreen:feature_flags",
"//ios/chrome/browser/ui/infobars:feature_flags", "//ios/chrome/browser/ui/infobars:feature_flags",
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
#include "ios/chrome/browser/passwords/password_manager_features.h" #include "ios/chrome/browser/passwords/password_manager_features.h"
#include "ios/chrome/browser/policy/policy_features.h" #include "ios/chrome/browser/policy/policy_features.h"
#include "ios/chrome/browser/system_flags.h" #include "ios/chrome/browser/system_flags.h"
#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h"
#import "ios/chrome/browser/ui/download/features.h" #import "ios/chrome/browser/ui/download/features.h"
#import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
#import "ios/chrome/browser/ui/infobars/infobar_feature.h" #import "ios/chrome/browser/ui/infobars/infobar_feature.h"
...@@ -632,7 +633,9 @@ const flags_ui::FeatureEntry kFeatureEntries[] = { ...@@ -632,7 +633,9 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
{"safety-check-ios", flag_descriptions::kSafetyCheckIOSName, {"safety-check-ios", flag_descriptions::kSafetyCheckIOSName,
flag_descriptions::kSafetyCheckIOSDescription, flags_ui::kOsIos, flag_descriptions::kSafetyCheckIOSDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kSafetyCheckIOS)}, FEATURE_VALUE_TYPE(kSafetyCheckIOS)},
{"discover-feed-ntp-ios", flag_descriptions::kDiscoverFeedInNtpName,
flag_descriptions::kDiscoverFeedInNtpDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kDiscoverFeedInNtp)},
}; };
bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) { bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
......
...@@ -178,6 +178,10 @@ const char kDisableAnimationOnLowBatteryName[] = ...@@ -178,6 +178,10 @@ const char kDisableAnimationOnLowBatteryName[] =
const char kDisableAnimationOnLowBatteryDescription[] = const char kDisableAnimationOnLowBatteryDescription[] =
"Disable animations when battery level goes below 20%"; "Disable animations when battery level goes below 20%";
const char kDiscoverFeedInNtpName[] = "Enable Discover feed in new tab page";
const char kDiscoverFeedInNtpDescription[] =
"When enabled, replaces articles feed with Discover feed in new tab page.";
const char kDownloadInfobarMessagesUIName[] = "Download Infobars Messages UI"; const char kDownloadInfobarMessagesUIName[] = "Download Infobars Messages UI";
const char kDownloadInfobarMessagesUIDescription[] = const char kDownloadInfobarMessagesUIDescription[] =
"When enabled Downloads use the new Messages UI."; "When enabled Downloads use the new Messages UI.";
......
...@@ -148,6 +148,11 @@ extern const char kDetectMainThreadFreezeDescription[]; ...@@ -148,6 +148,11 @@ extern const char kDetectMainThreadFreezeDescription[];
extern const char kDisableAnimationOnLowBatteryName[]; extern const char kDisableAnimationOnLowBatteryName[];
extern const char kDisableAnimationOnLowBatteryDescription[]; extern const char kDisableAnimationOnLowBatteryDescription[];
// Title and description for the flag to replace the Zine feed with the
// Discover feed in the Bling NTP.
extern const char kDiscoverFeedInNtpName[];
extern const char kDiscoverFeedInNtpDescription[];
// Title and description for the flag to enable the Messages UI for downloads. // Title and description for the flag to enable the Messages UI for downloads.
extern const char kDownloadInfobarMessagesUIName[]; extern const char kDownloadInfobarMessagesUIName[];
extern const char kDownloadInfobarMessagesUIDescription[]; extern const char kDownloadInfobarMessagesUIDescription[];
......
...@@ -419,3 +419,12 @@ source_set("test_support") { ...@@ -419,3 +419,12 @@ source_set("test_support") {
] ]
configs += [ "//build/config/compiler:enable_arc" ] configs += [ "//build/config/compiler:enable_arc" ]
} }
source_set("feature_flags") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [
"content_suggestions_feature.h",
"content_suggestions_feature.mm",
]
public_deps = [ "//base" ]
}
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_FEATURE_H_
#define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_FEATURE_H_
#include "base/feature_list.h"
// Feature to choose between the old Zine feed or the new Discover feed in the
// Bling new tab page.
// Use IsDiscoverFeedEnabled() instead of this constant directly.
extern const base::Feature kDiscoverFeedInNtp;
// Whether the Discover feed is enabled instead of the Zine feed.
bool IsDiscoverFeedEnabled();
#endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_FEATURE_H_
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
// Feature disabled by default to keep showing old Zine feed.
const base::Feature kDiscoverFeedInNtp{"DiscoverFeedInNtp",
base::FEATURE_DISABLED_BY_DEFAULT};
bool IsDiscoverFeedEnabled() {
return base::FeatureList::IsEnabled(kDiscoverFeedInNtp);
}
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