constants.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright 2022 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_SEGMENTATION_PLATFORM_PUBLIC_CONSTANTS_H_
  5. #define COMPONENTS_SEGMENTATION_PLATFORM_PUBLIC_CONSTANTS_H_
  6. #include <string>
  7. #include "components/segmentation_platform/public/proto/segmentation_platform.pb.h"
  8. namespace segmentation_platform {
  9. // The key to be used for adaptive toolbar feature.
  10. const char kAdaptiveToolbarSegmentationKey[] = "adaptive_toolbar";
  11. const char kAdaptiveToolbarUmaName[] = "AdaptiveToolbar";
  12. // The key to be used for any feature that needs to collect and store data on
  13. // client side while being built.
  14. const char kDummySegmentationKey[] = "dummy_feature";
  15. const char kDummyFeatureUmaName[] = "DummyFeature";
  16. // The key is used to decide whether to show Chrome Start or not.
  17. const char kChromeStartAndroidSegmentationKey[] = "chrome_start_android";
  18. const char kChromeStartAndroidUmaName[] = "ChromeStartAndroid";
  19. // The key is used to decide whether to show query tiles.
  20. const char kQueryTilesSegmentationKey[] = "query_tiles";
  21. const char kQueryTilesUmaName[] = "QueryTiles";
  22. // The key is used to decide whether a user has low user engagement with chrome.
  23. // This is a generic model that can be used by multiple features targeting
  24. // low-engaged users. Typically low engaged users are active in chrome below a
  25. // certain threshold number of days over a time period. This is computed using
  26. // Session.TotalDuration histogram.
  27. const char kChromeLowUserEngagementSegmentationKey[] =
  28. "chrome_low_user_engagement";
  29. const char kChromeLowUserEngagementUmaName[] = "ChromeLowUserEngagement";
  30. // The key is used to decide whether the user likes to use Feed.
  31. const char kFeedUserSegmentationKey[] = "feed_user_segment";
  32. const char kFeedUserSegmentUmaName[] = "FeedUserSegment";
  33. // The key is used to show a contextual page action.
  34. const char kContextualPageActionsKey[] = "contextual_page_actions";
  35. const char kContextualPageActionsUmaName[] = "ContextualPageActions";
  36. // The key provide a list of segment IDs, separated by commas, whose ML model
  37. // execution results are allowed to be uploaded through UKM.
  38. const char kSegmentIdsAllowedForReportingKey[] =
  39. "segment_ids_allowed_for_reporting";
  40. const char kSubsegmentDiscreteMappingSuffix[] = "_subsegment";
  41. // Returns an UMA display string for the given `segmentation_key`.
  42. const char* SegmentationKeyToUmaName(const std::string& segmentation_key);
  43. // Returns an UMA histogram variant for the given segment_id.
  44. std::string SegmentIdToHistogramVariant(proto::SegmentId segment_id);
  45. } // namespace segmentation_platform
  46. #endif // COMPONENTS_SEGMENTATION_PLATFORM_PUBLIC_CONSTANTS_H_