features.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // Copyright 2021 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_HISTORY_CLUSTERS_CORE_FEATURES_H_
  5. #define COMPONENTS_HISTORY_CLUSTERS_CORE_FEATURES_H_
  6. #include "base/feature_list.h"
  7. #include "base/metrics/field_trial_params.h"
  8. #include "base/time/time.h"
  9. #include "url/gurl.h"
  10. namespace history_clusters {
  11. // Features
  12. namespace internal {
  13. // Enables Journeys in the Chrome History WebUI. This flag shouldn't be checked
  14. // directly. Instead use `IsJourneysEnabled()` for the system language filter.
  15. extern const base::Feature kJourneys;
  16. // Enables labelling of Journeys in UI.
  17. extern const base::Feature kJourneysLabels;
  18. // Enables the Journeys Omnibox Action chip. `kJourneys` must also be enabled
  19. // for this to take effect.
  20. extern const base::Feature kOmniboxAction;
  21. // Enables the `HistoryClusterProvider` to surface Journeys as a suggestion row
  22. // instead of an action chip. Enabling this won't actually disable
  23. // `kOmniboxAction` but for user experiments, the intent is to only have 1
  24. // enabled. `kJourneys` must also be enabled for this to take effect.
  25. extern const base::Feature kOmniboxHistoryClusterProvider;
  26. // Enables debug info in non-user-visible surfaces, like Chrome Inspector.
  27. // Does nothing if `kJourneys` is disabled.
  28. extern const base::Feature kNonUserVisibleDebug;
  29. // Enables debug info in user-visible surfaces, like the actual WebUI page.
  30. // Does nothing if `kJourneys` is disabled.
  31. extern const base::Feature kUserVisibleDebug;
  32. // Enables persisting context annotations in the History DB. They are always
  33. // calculated anyways. This just enables storing them. This is expected to be
  34. // enabled for all users shortly. This just provides a killswitch.
  35. // This flag is to enable us to turn on persisting context annotations WITHOUT
  36. // exposing the Journeys UI in general. If EITHER this flag or `kJourneys` is
  37. // enabled, users will have context annotations persisted into their History DB.
  38. extern const base::Feature kPersistContextAnnotationsInHistoryDb;
  39. // Enables the history clusters internals page.
  40. extern const base::Feature kHistoryClustersInternalsPage;
  41. // Enables use of task runner with trait CONTINUE_ON_SHUTDOWN.
  42. extern const base::Feature kHistoryClustersUseContinueOnShutdown;
  43. // Enables use of additional keyword filtering operations on clusters.
  44. extern const base::Feature kHistoryClustersKeywordFiltering;
  45. } // namespace internal
  46. // The below features are NOT internal and NOT encapsulated in the Config class.
  47. // These are different because the base::Feature instance needs to be directly
  48. // referred to outside of Journeys code. Moreover, they are not used inside an
  49. // inner loop, so they don't need to be high performance.
  50. // Enables the user survey when the user clicks over to Journeys from History.
  51. extern const base::Feature kJourneysSurveyForHistoryEntrypoint;
  52. extern const base::FeatureParam<base::TimeDelta>
  53. kJourneysSurveyForHistoryEntrypointDelay;
  54. // Enables the user survey when the user uses the omnibox to access Journeys.
  55. extern const base::Feature kJourneysSurveyForOmniboxEntrypoint;
  56. extern const base::FeatureParam<base::TimeDelta>
  57. kJourneysSurveyForOmniboxEntrypointDelay;
  58. } // namespace history_clusters
  59. #endif // COMPONENTS_HISTORY_CLUSTERS_CORE_FEATURES_H_