feed_feature_list.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_FEED_FEED_FEATURE_LIST_H_
  5. #define COMPONENTS_FEED_FEED_FEATURE_LIST_H_
  6. #include <string>
  7. #include "base/feature_list.h"
  8. #include "base/metrics/field_trial_params.h"
  9. #include "build/build_config.h"
  10. #include "components/signin/public/base/consent_level.h"
  11. // TODO(crbug.com/1165828): Clean up feedv1 features.
  12. namespace feed {
  13. extern const base::Feature kInterestFeedContentSuggestions;
  14. extern const base::Feature kInterestFeedV2;
  15. extern const base::Feature kInterestFeedV2Autoplay;
  16. extern const base::Feature kInterestFeedV2Hearts;
  17. extern const base::Feature kInterestFeedV2Scrolling;
  18. extern const base::FeatureParam<std::string> kDisableTriggerTypes;
  19. extern const base::FeatureParam<int> kSuppressRefreshDurationMinutes;
  20. extern const base::FeatureParam<int> kTimeoutDurationSeconds;
  21. extern const base::FeatureParam<bool> kThrottleBackgroundFetches;
  22. extern const base::FeatureParam<bool> kOnlySetLastRefreshAttemptOnSuccess;
  23. // TODO(b/213622639): The following two features are obsolete and should be
  24. // removed.
  25. // Determines whether conditions should be reached before enabling the upload of
  26. // click and view actions in the feed (e.g., the user needs to view X cards).
  27. // For example, this is needed when the notice card is at the second position in
  28. // the feed.
  29. extern const base::Feature kInterestFeedV1ClicksAndViewsConditionalUpload;
  30. extern const base::Feature kInterestFeedV2ClicksAndViewsConditionalUpload;
  31. // Feature that allows the client to automatically dismiss the notice card based
  32. // on the clicks and views on the notice card.
  33. #if BUILDFLAG(IS_IOS)
  34. extern const base::Feature kInterestFeedNoticeCardAutoDismiss;
  35. #endif
  36. // Feature that allows users to keep up with and consume web content.
  37. extern const base::Feature kWebFeed;
  38. // Use the new DiscoFeed endpoint.
  39. extern const base::Feature kDiscoFeedEndpoint;
  40. // Feature that enables xsurface to provide the metrics reporting state to an
  41. // xsurface feed.
  42. extern const base::Feature kXsurfaceMetricsReporting;
  43. // Whether to log reliability events.
  44. extern const base::Feature kReliabilityLogging;
  45. // Feature that enables refreshing feeds triggered by the users.
  46. extern const base::Feature kFeedInteractiveRefresh;
  47. // Feature that shows placeholder cards instead of a loading spinner at first
  48. // load.
  49. extern const base::Feature kFeedLoadingPlaceholder;
  50. // Param allowing animations to be disabled when showing the placeholder on
  51. // instant start.
  52. extern const base::FeatureParam<bool>
  53. kEnableFeedLoadingPlaceholderAnimationOnInstantStart;
  54. // Feature that allows tuning the size of the image memory cache. Value is a
  55. // percentage of the maximum size calculated for the device.
  56. extern const base::Feature kFeedImageMemoryCacheSizePercentage;
  57. // Feature that enables clearing the image memory cache when the feed is
  58. // destroyed.
  59. extern const base::Feature kFeedClearImageMemoryCache;
  60. // Feature that enables showing a callout to help users return to the top of the
  61. // feeds quickly.
  62. extern const base::Feature kFeedBackToTop;
  63. // Feature that enables StAMP cards in the feed.
  64. extern const base::Feature kFeedStamp;
  65. // Feature that provides the user assistance in discovering the web feed.
  66. extern const base::Feature kWebFeedAwareness;
  67. // Feature that provides the user assistance in using the web feed.
  68. extern const base::Feature kWebFeedOnboarding;
  69. // Feature that enables sorting by different heuristics in the web feed.
  70. extern const base::Feature kWebFeedSort;
  71. // Feature that causes the "open in new tab" menu item to appear on feed items
  72. // on Start Surface.
  73. extern const base::Feature kEnableOpenInNewTabFromStartSurfaceFeed;
  74. // Feature that causes the WebUI version of the Feed to be enabled.
  75. extern const base::Feature kWebUiFeed;
  76. extern const base::FeatureParam<std::string> kWebUiFeedUrl;
  77. extern const base::FeatureParam<bool> kWebUiDisableContentSecurityPolicy;
  78. std::string GetFeedReferrerUrl();
  79. // Personalize feed for unsigned users.
  80. extern const base::Feature kPersonalizeFeedUnsignedUsers;
  81. // Personalize feed for signed in users who haven't enabled sync.
  82. extern const base::Feature kPersonalizeFeedNonSyncUsers;
  83. // Returns the consent level needed to request a personalized feed.
  84. signin::ConsentLevel GetConsentLevelNeededForPersonalizedFeed();
  85. // Feature that enables tracking the acknowledgement state for the info cards.
  86. extern const base::Feature kInfoCardAcknowledgementTracking;
  87. // Feature that enables the Crow feature.
  88. // Owned by the CwF team but located here until it makes sense to create a crow
  89. // component, since it is being used in the feed component.
  90. extern const base::Feature kShareCrowButton;
  91. // Feature that when enabled completely removes all Feeds from chrome.
  92. extern const base::Feature kIsAblated;
  93. // When enabled, schedule a background refresh for a feed sometime after the
  94. // last user engagement with that feed.
  95. extern const base::Feature kFeedCloseRefresh;
  96. // On each qualifying user engagement, schedule a background refresh this many
  97. // minutes out.
  98. extern const base::FeatureParam<int> kFeedCloseRefreshDelayMinutes;
  99. // If true, schedule the refresh only when the user scrolls or interacts. If
  100. // false, schedule only when the feed surface is opened to content.
  101. extern const base::FeatureParam<bool> kFeedCloseRefreshRequireInteraction;
  102. // When enabled, no view cache is used.
  103. extern const base::Feature kFeedNoViewCache;
  104. // When enabled, replace all items.
  105. extern const base::Feature kFeedReplaceAll;
  106. } // namespace feed
  107. #endif // COMPONENTS_FEED_FEED_FEATURE_LIST_H_