page_content_annotation_type.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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_OPTIMIZATION_GUIDE_CORE_PAGE_CONTENT_ANNOTATION_TYPE_H_
  5. #define COMPONENTS_OPTIMIZATION_GUIDE_CORE_PAGE_CONTENT_ANNOTATION_TYPE_H_
  6. #include <string>
  7. namespace optimization_guide {
  8. // The type of annotation that is being done on the given input.
  9. //
  10. // Each of these is used in UMA histograms so please update the variants there
  11. // when any changes are made.
  12. // //tools/metrics/histograms/metadata/optimization/histograms.xml
  13. enum class AnnotationType {
  14. kUnknown,
  15. // The input will be annotated with the topics on the page. These topics are
  16. // fairly high-level like "sports" or "news".
  17. kPageTopics,
  18. // The input will be annotated for the visibility of the content.
  19. kContentVisibility,
  20. // The input will be annotated with the entities on the page. If the entities
  21. // will be persisted, make sure that only the entity IDs are persisted. To map
  22. // the IDs back to human-readable strings, use `EntityMetadataProvider`.
  23. kPageEntities,
  24. };
  25. std::string AnnotationTypeToString(AnnotationType type);
  26. } // namespace optimization_guide
  27. #endif // COMPONENTS_OPTIMIZATION_GUIDE_CORE_PAGE_CONTENT_ANNOTATION_TYPE_H_