Lens Shopping chip implementation for context menu
Dark Mode single line: https://drive.google.com/file/d/1_sK8UZ3bXhQjsvpFEWGfzB1d4A105M3t/view
Light Mode multi-line: https://drive.google.com/file/d/16uwoOIRa7jAv08KTMNKcmE4qbDoH79NE/view
There are still a few bugs which will need to be fixed in a follow up:
1. Multiline text hides the close button and doesn't have correct alignment/padding
2. Dark color mode should match context menu color (adaptive color needs to be added for this case).
Change-Id: Id9196815d4e9539a53c0e01aa52e104be28b9b99
Bug: 1099982
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2340007
Commit-Queue: Ben Goldberger <[email protected]>
Reviewed-by: Theresa <[email protected]>
Reviewed-by: Sinan Sahin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#805370}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 92ce054..45a812e 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -5687,6 +5687,11 @@
"QuietNotificationPrompts")},
#if defined(OS_ANDROID)
+ {"context-menu-google-lens-chip",
+ flag_descriptions::kContextMenuGoogleLensChipName,
+ flag_descriptions::kContextMenuGoogleLensChipDescription, kOsAndroid,
+ FEATURE_VALUE_TYPE(chrome::android::kContextMenuGoogleLensChip)},
+
{"context-menu-search-with-google-lens",
flag_descriptions::kContextMenuSearchWithGoogleLensName,
flag_descriptions::kContextMenuSearchWithGoogleLensDescription, kOsAndroid,
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index 90c8f4c1..3257432 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -567,6 +567,11 @@
"expiry_milestone": 88
},
{
+ "name": "context-menu-google-lens-chip",
+ "owners": [ "yusuyoutube", "benwgold", "lens-chrome" ],
+ "expiry_milestone": 90
+ },
+ {
"name": "context-menu-performance-info-and-remote-hints-fetching",
"owners": [ "jds" ],
"expiry_milestone": 90
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index e4f4cf8..9f663f6 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -349,6 +349,12 @@
"eligibility requirements for showing app banners, such as having a "
"manifest, are met.";
+const char kContextMenuGoogleLensChipName[] =
+ "Google Lens powered image search for surfaced as a chip below the context "
+ "menu.";
+const char kContextMenuGoogleLensChipDescription[] =
+ "Enable a chip for a Shopping intent into Google Lens when supported. ";
+
const char kContextMenuSearchWithGoogleLensName[] =
"Google Lens powered image search in the context menu.";
const char kContextMenuSearchWithGoogleLensDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index a8a80f11..3c8d5988 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -209,6 +209,9 @@
extern const char kBypassAppBannerEngagementChecksName[];
extern const char kBypassAppBannerEngagementChecksDescription[];
+extern const char kContextMenuGoogleLensChipName[];
+extern const char kContextMenuGoogleLensChipDescription[];
+
extern const char kContextMenuSearchWithGoogleLensName[];
extern const char kContextMenuSearchWithGoogleLensDescription[];
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
index 1b9f5eb0..9615d766 100644
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -139,6 +139,7 @@
&kContentSuggestionsScrollToLoad,
&kContextMenuEnableLensShoppingAllowlist,
&kContextMenuCopyImage,
+ &kContextMenuGoogleLensChip,
&kContextMenuSearchWithGoogleLens,
&kContextMenuShopWithGoogleLens,
&kContextMenuSearchAndShopWithGoogleLens,
@@ -404,6 +405,9 @@
const base::Feature kContextMenuCopyImage{"ContextMenuCopyImage",
base::FEATURE_ENABLED_BY_DEFAULT};
+const base::Feature kContextMenuGoogleLensChip{
+ "ContextMenuGoogleLensChip", base::FEATURE_DISABLED_BY_DEFAULT};
+
const base::Feature kContextMenuSearchWithGoogleLens{
"ContextMenuSearchWithGoogleLens", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h
index b176802..8e239aa 100644
--- a/chrome/browser/flags/android/chrome_feature_list.h
+++ b/chrome/browser/flags/android/chrome_feature_list.h
@@ -49,6 +49,7 @@
extern const base::Feature kContentIndexingNTP;
extern const base::Feature kContextMenuCopyImage;
extern const base::Feature kContextMenuEnableLensShoppingAllowlist;
+extern const base::Feature kContextMenuGoogleLensChip;
extern const base::Feature kContextMenuPerformanceInfo;
extern const base::Feature kContextMenuSearchWithGoogleLens;
extern const base::Feature kContextMenuShopWithGoogleLens;
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
index 5c226620..309818d9 100644
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -255,6 +255,7 @@
public static final String CONTEXT_MENU_ENABLE_LENS_SHOPPING_ALLOWLIST =
"ContextMenuEnableLensShoppingAllowlist";
public static final String CONTEXT_MENU_COPY_IMAGE = "ContextMenuCopyImage";
+ public static final String CONTEXT_MENU_GOOGLE_LENS_CHIP = "ContextMenuGoogleLensChip";
public static final String CONTEXT_MENU_SEARCH_WITH_GOOGLE_LENS =
"ContextMenuSearchWithGoogleLens";
public static final String CONTEXT_MENU_SHOP_WITH_GOOGLE_LENS = "ContextMenuShopWithGoogleLens";