Commit de06e2cd authored by Donn Denman's avatar Donn Denman Committed by Commit Bot

[TTS] Add an IPH to enable for improving translations

Adds a new In Product Help bubble that suggests that the user
should enable access to page content in order to improve translations.

This includes handling of the IPH, but not any triggering of the IPH
or noting that the expected user response event has occurred.

Following instructions here:
https://chromium.googlesource.com/chromium/src/+/refs/heads/master/docs/translation_screenshots.md

BUG=1120080

Change-Id: Ib929b40d9b0954bfba5ed80ba02d3913ec30f1f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2368472
Commit-Queue: Theresa  <twellington@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarJinsuk Kim <jinsukkim@chromium.org>
Auto-Submit: Donn Denman <donnd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800459}
parent 6aa4380e
...@@ -157,6 +157,9 @@ public class ContextualSearchIPH { ...@@ -157,6 +157,9 @@ public class ContextualSearchIPH {
stringId = R.string.contextual_search_iph_touch_and_hold; stringId = R.string.contextual_search_iph_touch_and_hold;
} }
break; break;
case FeatureConstants.CONTEXTUAL_SEARCH_TRANSLATION_ENABLE_FEATURE:
stringId = R.string.contextual_search_iph_enable;
break;
} }
assert stringId != 0; assert stringId != 0;
......
...@@ -3081,6 +3081,9 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p ...@@ -3081,6 +3081,9 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_CONTEXTUAL_SEARCH_QUICK_ACTION_CAPTION_GENERIC_WEBSITE" desc="Caption displayed in the Contextual Search bar prompting the user to navigate to a web page."> <message name="IDS_CONTEXTUAL_SEARCH_QUICK_ACTION_CAPTION_GENERIC_WEBSITE" desc="Caption displayed in the Contextual Search bar prompting the user to navigate to a web page.">
Go to page Go to page
</message> </message>
<message name="IDS_CONTEXTUAL_SEARCH_IPH_ENABLE" desc="An in-product-help message for the Touch to Search feature on Chrome Android. The message encourages users to let Google Search servers have access to the page content to get better translations.">
To get better translations, let Google Search use the current page
</message>
<message name="IDS_CONTEXTUAL_SEARCH_IPH_ENTITY" desc="An in-product-help message for the Tap to Search feature on Chrome Android. The message encourages users to open a panel that contains search results for the word or phrase they tapped on."> <message name="IDS_CONTEXTUAL_SEARCH_IPH_ENTITY" desc="An in-product-help message for the Tap to Search feature on Chrome Android. The message encourages users to open a panel that contains search results for the word or phrase they tapped on.">
See instant search results in this panel See instant search results in this panel
</message> </message>
......
...@@ -23,6 +23,7 @@ import java.lang.annotation.RetentionPolicy; ...@@ -23,6 +23,7 @@ import java.lang.annotation.RetentionPolicy;
FeatureConstants.DATA_SAVER_PREVIEW_FEATURE, FeatureConstants.DATA_SAVER_DETAIL_FEATURE, FeatureConstants.DATA_SAVER_PREVIEW_FEATURE, FeatureConstants.DATA_SAVER_DETAIL_FEATURE,
FeatureConstants.EPHEMERAL_TAB_FEATURE, FeatureConstants.PREVIEWS_OMNIBOX_UI_FEATURE, FeatureConstants.EPHEMERAL_TAB_FEATURE, FeatureConstants.PREVIEWS_OMNIBOX_UI_FEATURE,
FeatureConstants.TRANSLATE_MENU_BUTTON_FEATURE, FeatureConstants.TRANSLATE_MENU_BUTTON_FEATURE,
FeatureConstants.CONTEXTUAL_SEARCH_TRANSLATION_ENABLE_FEATURE,
FeatureConstants.CONTEXTUAL_SEARCH_WEB_SEARCH_FEATURE, FeatureConstants.CONTEXTUAL_SEARCH_WEB_SEARCH_FEATURE,
FeatureConstants.CONTEXTUAL_SEARCH_PROMOTE_TAP_FEATURE, FeatureConstants.CONTEXTUAL_SEARCH_PROMOTE_TAP_FEATURE,
FeatureConstants.CONTEXTUAL_SEARCH_PROMOTE_PANEL_OPEN_FEATURE, FeatureConstants.CONTEXTUAL_SEARCH_PROMOTE_PANEL_OPEN_FEATURE,
...@@ -65,6 +66,12 @@ public @interface FeatureConstants { ...@@ -65,6 +66,12 @@ public @interface FeatureConstants {
String TRANSLATE_MENU_BUTTON_FEATURE = "IPH_TranslateMenuButton"; String TRANSLATE_MENU_BUTTON_FEATURE = "IPH_TranslateMenuButton";
String EXPLORE_SITES_TILE_FEATURE = "IPH_ExploreSitesTile"; String EXPLORE_SITES_TILE_FEATURE = "IPH_ExploreSitesTile";
/**
* An IPH feature that encourages users to get better translations by enabling access to page
* content.
*/
String CONTEXTUAL_SEARCH_TRANSLATION_ENABLE_FEATURE = "IPH_ContextualSearchTranslationEnable";
/** /**
* An IPH feature that encourages users who search a query from a web page in a new tab, to use * An IPH feature that encourages users who search a query from a web page in a new tab, to use
* Contextual Search instead. * Contextual Search instead.
......
...@@ -52,6 +52,8 @@ const base::Feature kIPHChromeHomeExpandFeature{ ...@@ -52,6 +52,8 @@ const base::Feature kIPHChromeHomeExpandFeature{
"IPH_ChromeHomeExpand", base::FEATURE_DISABLED_BY_DEFAULT}; "IPH_ChromeHomeExpand", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kIPHChromeHomePullToRefreshFeature{ const base::Feature kIPHChromeHomePullToRefreshFeature{
"IPH_ChromeHomePullToRefresh", base::FEATURE_DISABLED_BY_DEFAULT}; "IPH_ChromeHomePullToRefresh", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kIPHContextualSearchTranslationEnableFeature{
"IPH_ContextualSearchTranslationEnable", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kIPHContextualSearchWebSearchFeature{ const base::Feature kIPHContextualSearchWebSearchFeature{
"IPH_ContextualSearchWebSearch", base::FEATURE_DISABLED_BY_DEFAULT}; "IPH_ContextualSearchWebSearch", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kIPHContextualSearchPromoteTapFeature{ const base::Feature kIPHContextualSearchPromoteTapFeature{
......
...@@ -42,6 +42,7 @@ extern const base::Feature kIPHChromeDuetSearchFeature; ...@@ -42,6 +42,7 @@ extern const base::Feature kIPHChromeDuetSearchFeature;
extern const base::Feature kIPHChromeDuetTabSwitcherFeature; extern const base::Feature kIPHChromeDuetTabSwitcherFeature;
extern const base::Feature kIPHChromeHomeExpandFeature; extern const base::Feature kIPHChromeHomeExpandFeature;
extern const base::Feature kIPHChromeHomePullToRefreshFeature; extern const base::Feature kIPHChromeHomePullToRefreshFeature;
extern const base::Feature kIPHContextualSearchTranslationEnableFeature;
extern const base::Feature kIPHContextualSearchWebSearchFeature; extern const base::Feature kIPHContextualSearchWebSearchFeature;
extern const base::Feature kIPHContextualSearchPromoteTapFeature; extern const base::Feature kIPHContextualSearchPromoteTapFeature;
extern const base::Feature kIPHContextualSearchPromotePanelOpenFeature; extern const base::Feature kIPHContextualSearchPromotePanelOpenFeature;
......
...@@ -30,6 +30,7 @@ const base::Feature* const kAllFeatures[] = { ...@@ -30,6 +30,7 @@ const base::Feature* const kAllFeatures[] = {
&kIPHChromeReengagementNotification1Feature, &kIPHChromeReengagementNotification1Feature,
&kIPHChromeReengagementNotification2Feature, &kIPHChromeReengagementNotification2Feature,
&kIPHChromeReengagementNotification3Feature, &kIPHChromeReengagementNotification3Feature,
&kIPHContextualSearchTranslationEnableFeature,
&kIPHContextualSearchWebSearchFeature, &kIPHContextualSearchWebSearchFeature,
&kIPHContextualSearchPromoteTapFeature, &kIPHContextualSearchPromoteTapFeature,
&kIPHContextualSearchPromotePanelOpenFeature, &kIPHContextualSearchPromotePanelOpenFeature,
......
...@@ -68,6 +68,8 @@ DEFINE_VARIATION_PARAM(kIPHChromeReengagementNotification2Feature, ...@@ -68,6 +68,8 @@ DEFINE_VARIATION_PARAM(kIPHChromeReengagementNotification2Feature,
"IPH_ChromeReengagementNotification2"); "IPH_ChromeReengagementNotification2");
DEFINE_VARIATION_PARAM(kIPHChromeReengagementNotification3Feature, DEFINE_VARIATION_PARAM(kIPHChromeReengagementNotification3Feature,
"IPH_ChromeReengagementNotification3"); "IPH_ChromeReengagementNotification3");
DEFINE_VARIATION_PARAM(kIPHContextualSearchTranslationEnableFeature,
"IPH_ContextualSearchTranslationEnable");
DEFINE_VARIATION_PARAM(kIPHContextualSearchWebSearchFeature, DEFINE_VARIATION_PARAM(kIPHContextualSearchWebSearchFeature,
"IPH_ContextualSearchWebSearch"); "IPH_ContextualSearchWebSearch");
DEFINE_VARIATION_PARAM(kIPHContextualSearchPromoteTapFeature, DEFINE_VARIATION_PARAM(kIPHContextualSearchPromoteTapFeature,
...@@ -157,6 +159,7 @@ constexpr flags_ui::FeatureEntry::FeatureVariation ...@@ -157,6 +159,7 @@ constexpr flags_ui::FeatureEntry::FeatureVariation
VARIATION_ENTRY(kIPHChromeReengagementNotification1Feature), VARIATION_ENTRY(kIPHChromeReengagementNotification1Feature),
VARIATION_ENTRY(kIPHChromeReengagementNotification2Feature), VARIATION_ENTRY(kIPHChromeReengagementNotification2Feature),
VARIATION_ENTRY(kIPHChromeReengagementNotification3Feature), VARIATION_ENTRY(kIPHChromeReengagementNotification3Feature),
VARIATION_ENTRY(kIPHContextualSearchTranslationEnableFeature),
VARIATION_ENTRY(kIPHContextualSearchWebSearchFeature), VARIATION_ENTRY(kIPHContextualSearchWebSearchFeature),
VARIATION_ENTRY(kIPHContextualSearchPromoteTapFeature), VARIATION_ENTRY(kIPHContextualSearchPromoteTapFeature),
VARIATION_ENTRY(kIPHContextualSearchPromotePanelOpenFeature), VARIATION_ENTRY(kIPHContextualSearchPromotePanelOpenFeature),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment