lens_features.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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_LENS_LENS_FEATURES_H_
  5. #define COMPONENTS_LENS_LENS_FEATURES_H_
  6. #include <string>
  7. #include "base/feature_list.h"
  8. #include "base/metrics/field_trial_params.h"
  9. namespace lens {
  10. namespace features {
  11. // Enables context menu search by image sending to the Lens homepage.
  12. extern const base::Feature kLensStandalone;
  13. // Feature that controls the compression of images before they are sent to Lens.
  14. extern const base::Feature kLensImageCompression;
  15. // Enables a variety of changes aimed to improve user's engagement with current
  16. // Lens features.
  17. extern const base::Feature kLensSearchOptimizations;
  18. // Enables a fix to properly handle transparent images in Lens Image Search
  19. extern const base::Feature kLensTransparentImagesFix;
  20. // Enables Lens integration into the Chrome screenshot sharing feature by adding
  21. // a "Search Image" button.
  22. extern const base::Feature kLensSearchImageInScreenshotSharing;
  23. // Enable the Lens Region Search feature on the PDF viewer.
  24. extern const base::Feature kEnableRegionSearchOnPdfViewer;
  25. // Enables the modification of the instruction chip UI that is presented when
  26. // region search is opened.
  27. extern const base::Feature kLensInstructionChipImprovements;
  28. // Enables using `Google` as the visual search provider instead of `Google
  29. // Lens`.
  30. extern const base::FeatureParam<bool> kUseGoogleAsVisualSearchProvider;
  31. // Enables alternate option 1 for the Region Search context menu item text.
  32. extern const base::FeatureParam<bool> kRegionSearchUseMenuItemAltText1;
  33. // Enables alternate option 2 for the Region Search context menu item text.
  34. extern const base::FeatureParam<bool> kRegionSearchUseMenuItemAltText2;
  35. // Enables alternate option 3 for the Region Search context menu item text.
  36. extern const base::FeatureParam<bool> kRegionSearchUseMenuItemAltText3;
  37. // Enables UKM logging for the Lens Region Search feature.
  38. extern const base::FeatureParam<bool> kEnableUKMLoggingForRegionSearch;
  39. // Enables UKM logging for the LensStandalone feature.
  40. extern const base::FeatureParam<bool> kEnableUKMLoggingForImageSearch;
  41. // Enables the side panel for Lens features on Chrome where supported.
  42. extern const base::FeatureParam<bool> kEnableSidePanelForLens;
  43. // Enables footer for the unified side panel
  44. extern const base::Feature kLensUnifiedSidePanelFooter;
  45. // Enables Lens fullscreen search on Desktop platforms.
  46. extern const base::FeatureParam<bool> kEnableFullscreenSearch;
  47. // Enables using side panel in the Chrome Screenshot sharing feature integration
  48. // instead of a new tab.
  49. extern const base::FeatureParam<bool> kUseSidePanelForScreenshotSharing;
  50. // Forces the Chrome Screenshot sharing dialog bubble to stay open after the
  51. // user clicks the Search Image button.
  52. extern const base::FeatureParam<bool> kEnablePersistentBubble;
  53. // Enables the use of the selection with image icon when using the instruction
  54. // chip improvements feature.
  55. extern const base::FeatureParam<bool> kUseSelectionIconWithImage;
  56. // Enables the use of an alternative string for the instruction chip.
  57. extern const base::FeatureParam<bool> kUseAltChipString;
  58. // Returns whether to enable UKM logging for Lens Region Search feature.
  59. extern bool GetEnableUKMLoggingForRegionSearch();
  60. // Returns whether to enable UKM logging for LensStandalone feature.
  61. extern bool GetEnableUKMLoggingForImageSearch();
  62. // Returns whether to enable footer for lens in the unified side panel
  63. extern bool GetEnableLensSidePanelFooter();
  64. // Returns the max pixel width/height for the image to be sent to Lens via
  65. // region search. The images are sent at 1x as PNGs.
  66. extern int GetMaxPixelsForRegionSearch();
  67. // Returns the max area for the image to be sent to Lens via region search.
  68. extern int GetMaxAreaForRegionSearch();
  69. // Returns the max pixel width/height for the image to be sent to Lens.
  70. extern int GetMaxPixelsForImageSearch();
  71. // The URL for the Lens home page.
  72. extern std::string GetHomepageURLForLens();
  73. // Returns whether Lens fullscreen search is enabled.
  74. extern bool IsLensFullscreenSearchEnabled();
  75. // Returns whether to use alternative option 1 for the Region Search context
  76. // menu item text.
  77. extern bool UseRegionSearchMenuItemAltText1();
  78. // Returns whether to use alternative option 2 for the Region Search context
  79. // menu item text.
  80. extern bool UseRegionSearchMenuItemAltText2();
  81. // Returns whether to use alternative option 3 for the Region Search context
  82. // menu item text.
  83. extern bool UseRegionSearchMenuItemAltText3();
  84. // Returns whether to use `Google` as the visual search provider for all
  85. // relevant Lens context menu strings.
  86. extern bool UseGoogleAsVisualSearchProvider();
  87. // Returns whether the Lens side panel is enabled.
  88. extern bool IsLensSidePanelEnabled();
  89. // Returns whether to send images to Lens Standalone as PNG
  90. extern bool GetSendImagesAsPng();
  91. // Returns whether the Search Image button in the Chrome Screenshot Sharing
  92. // feature is enabled
  93. extern bool IsLensInScreenshotSharingEnabled();
  94. // Returns whether the instruction chip improvement feature is enabled.
  95. extern bool IsLensInstructionChipImprovementsEnabled();
  96. // Returns whether to use the Chrome Side Panel for the Lens integration in
  97. // Chrome Screenshot Sharing feature
  98. extern bool UseSidePanelForScreenshotSharing();
  99. // Returns whether the Chrome Screenshot Sharing Bubble disappears after the
  100. // user clicks the Search Image button
  101. extern bool EnablePersistentBubble();
  102. // Returns if we should use the selection with image icon instead of the default
  103. // when using the instruction chip improvements feature.
  104. extern bool UseSelectionIconWithImage();
  105. // Returns whether we should use an alternative instruction chip string.
  106. extern bool UseAltChipString();
  107. } // namespace features
  108. } // namespace lens
  109. #endif // COMPONENTS_LENS_LENS_FEATURES_H_