ntp_features.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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_SEARCH_NTP_FEATURES_H_
  5. #define COMPONENTS_SEARCH_NTP_FEATURES_H_
  6. #include <string>
  7. #include <vector>
  8. #include "base/feature_list.h"
  9. #include "base/metrics/field_trial_params.h"
  10. namespace base {
  11. class TimeDelta;
  12. } // namespace base
  13. namespace ntp_features {
  14. // The features should be documented alongside the definition of their values in
  15. // the .cc file.
  16. extern const base::Feature kConfirmSuggestionRemovals;
  17. extern const base::Feature kCacheOneGoogleBar;
  18. extern const base::Feature kCustomizeChromeSidePanel;
  19. extern const base::Feature kCwsScrimRemoval;
  20. extern const base::Feature kDismissPromos;
  21. extern const base::Feature kIframeOneGoogleBar;
  22. extern const base::Feature kOneGoogleBarModalOverlays;
  23. extern const base::Feature kRealboxMatchOmniboxTheme;
  24. extern const base::Feature kRealboxMatchSearchboxTheme;
  25. extern const base::Feature kRealboxUseGoogleGIcon;
  26. extern const base::Feature kNtpChromeCartModule;
  27. extern const base::Feature kNtpDriveModule;
  28. #if !defined(OFFICIAL_BUILD)
  29. extern const base::Feature kNtpDummyModules;
  30. #endif
  31. extern const base::Feature kNtpLogo;
  32. extern const base::Feature kNtpMiddleSlotPromo;
  33. extern const base::Feature kNtpMiddleSlotPromoDismissal;
  34. extern const base::Feature kNtpModulesLoadTimeoutMilliseconds;
  35. extern const base::Feature kNtpModulesOrder;
  36. extern const base::Feature kNtpModulesDragAndDrop;
  37. extern const base::Feature kNtpModulesFirstRunExperience;
  38. extern const base::Feature kNtpModulesLoad;
  39. extern const base::Feature kNtpModulesRedesigned;
  40. extern const base::Feature kNtpModulesRedesignedLayout;
  41. extern const base::Feature kNtpPhotosModule;
  42. extern const base::Feature kNtpPhotosModuleSoftOptOut;
  43. extern const base::Feature kNtpPhotosModuleCustomizedOptInTitle;
  44. extern const base::Feature kNtpPhotosModuleCustomizedOptInArtWork;
  45. extern const base::Feature kNtpPhotosModuleSplitSvgOptInArtWork;
  46. extern const base::Feature kNtpFeedModule;
  47. extern const base::Feature kNtpOneGoogleBar;
  48. extern const base::Feature kNtpRecipeTasksModule;
  49. extern const base::Feature kNtpSafeBrowsingModule;
  50. extern const base::Feature kNtpShortcuts;
  51. extern const base::Feature kNtpHandleMostVisitedNavigationExplicitly;
  52. // Parameter determining the module load timeout.
  53. extern const char kNtpModulesLoadTimeoutMillisecondsParam[];
  54. // Parameter determining the module order.
  55. extern const char kNtpModulesOrderParam[];
  56. // Parameter determining the type of cart data used to render module.
  57. extern const char kNtpChromeCartModuleDataParam[];
  58. // Parameter for enabling the abandoned cart discount.
  59. extern const char kNtpChromeCartModuleAbandonedCartDiscountParam[];
  60. // Parameter for enabling the abandoned cart discount with utm_source tag to
  61. // indicate the feature state.
  62. extern const char kNtpChromeCartModuleAbandonedCartDiscountUseUtmParam[];
  63. // Parameter for enabling the cart heuristics improvement.
  64. extern const char kNtpChromeCartModuleHeuristicsImprovementParam[];
  65. // Parameter for enabling coupons on the Cart module.
  66. extern const char kNtpChromeCartModuleCouponParam[];
  67. // Parameter determining the type of Drive data to render.
  68. extern const char kNtpDriveModuleDataParam[];
  69. // Parameter for enabling the Drive module for managed users only.
  70. extern const char kNtpDriveModuleManagedUsersOnlyParam[];
  71. // Parameter determining the max age in seconds of the cache for drive data.
  72. extern const char kNtpDriveModuleCacheMaxAgeSParam[];
  73. // Parameter for communicating the experiment group of the Drive module
  74. // experiment.
  75. extern const char kNtpDriveModuleExperimentGroupParam[];
  76. // Parameter determining the type of middle slot promo data to render.
  77. extern const char kNtpMiddleSlotPromoDismissalParam[];
  78. // Parameter determining the type of Photos data to render.
  79. extern const char kNtpPhotosModuleDataParam[];
  80. // Parameter determining the art work in opt-in card.
  81. extern const char kNtpPhotosModuleOptInArtWorkParam[];
  82. // Parameter determining the title for the opt-in card.
  83. extern const char kNtpPhotosModuleOptInTitleParam[];
  84. // Parameter determining the number of times a module is shown to a user
  85. // before cooldown starts.
  86. extern const char kNtpSafeBrowsingModuleCountMaxParam[];
  87. // Parameter determining the cooldown period (in days) for a target user.
  88. extern const char kNtpSafeBrowsingModuleCooldownPeriodDaysParam[];
  89. // Parameter determining the variation of the omnibox theme matching.
  90. extern const char kRealboxMatchOmniboxThemeVariantParam[];
  91. // Parameter determining the variations of searchbox theme matching.
  92. extern const char kRealboxMatchSearchboxThemeParam[];
  93. // Parameter determining the type of recipe data to request.
  94. extern const char kNtpRecipeTasksModuleDataParam[];
  95. // Parameter determining the max age in seconds of the cache for recipe tasks
  96. // data.
  97. extern const char kNtpRecipeTasksModuleCacheMaxAgeSParam[];
  98. // Parameter for communicating the experiment group of the recipe tasks module
  99. // experiment.
  100. extern const char kNtpRecipeTasksModuleExperimentGroupParam[];
  101. // Returns the timeout after which the load of a module should be aborted.
  102. base::TimeDelta GetModulesLoadTimeout();
  103. // Returns a list of module IDs ordered by how they should appear on the NTP.
  104. std::vector<std::string> GetModulesOrder();
  105. } // namespace ntp_features
  106. #endif // COMPONENTS_SEARCH_NTP_FEATURES_H_