Commit 80691f17 authored by Friedrich Horschig's avatar Friedrich Horschig Committed by Commit Bot

[Mfill][Android] Highlight 'Chrome' in filling IPH

Instead of just telling users what a chip fills, highlight that a chip
is an *autofill suggestion* provided by *Chrome*.

IDS_IPH_KEYBOARD_ACCESSORY_FILL_WITH_CHROME screenshot:
https://storage.cloud.google.com/chromium-translation-screenshots/1b93b6afc656909bacdf8f62712a21b5990c7ac4

Bug: 1124711
Change-Id: Iefb80ccd3f59a865da661cf51d1308095c58fcb6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2418312Reviewed-by: default avatarIoana Pandele <ioanap@chromium.org>
Commit-Queue: Friedrich [CET] <fhorschig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808348}
parent a82b58b5
...@@ -12,7 +12,7 @@ import org.chromium.chrome.browser.feature_engagement.TrackerFactory; ...@@ -12,7 +12,7 @@ import org.chromium.chrome.browser.feature_engagement.TrackerFactory;
import org.chromium.chrome.browser.keyboard_accessory.R; import org.chromium.chrome.browser.keyboard_accessory.R;
import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.util.ChromeAccessibilityUtil; import org.chromium.chrome.browser.util.ChromeAccessibilityUtil;
import org.chromium.components.browser_ui.widget.textbubble.ImageTextBubble; import org.chromium.components.browser_ui.widget.textbubble.TextBubble;
import org.chromium.components.feature_engagement.EventConstants; import org.chromium.components.feature_engagement.EventConstants;
import org.chromium.components.feature_engagement.FeatureConstants; import org.chromium.components.feature_engagement.FeatureConstants;
import org.chromium.components.feature_engagement.Tracker; import org.chromium.components.feature_engagement.Tracker;
...@@ -69,9 +69,8 @@ class KeyboardAccessoryIPHUtils { ...@@ -69,9 +69,8 @@ class KeyboardAccessoryIPHUtils {
if (!tracker.shouldTriggerHelpUI(feature)) return; // This call records the IPH intent. if (!tracker.shouldTriggerHelpUI(feature)) return; // This call records the IPH intent.
@StringRes @StringRes
int helpText = getHelpTextForFeature(feature); int helpText = getHelpTextForFeature(feature);
ImageTextBubble helpBubble = new ImageTextBubble(view.getContext(), rootView, helpText, TextBubble helpBubble = new TextBubble(view.getContext(), rootView, helpText, helpText,
helpText, true, new ViewRectProvider(view), R.drawable.ic_chrome, new ViewRectProvider(view), ChromeAccessibilityUtil.get().isAccessibilityEnabled());
ChromeAccessibilityUtil.get().isAccessibilityEnabled());
helpBubble.setDismissOnTouchInteraction(true); helpBubble.setDismissOnTouchInteraction(true);
helpBubble.show(); helpBubble.show();
// To emphasize which chip is pointed to, set selected to true for the built-in highlight. // To emphasize which chip is pointed to, set selected to true for the built-in highlight.
...@@ -91,11 +90,9 @@ class KeyboardAccessoryIPHUtils { ...@@ -91,11 +90,9 @@ class KeyboardAccessoryIPHUtils {
private static @StringRes int getHelpTextForFeature(@FeatureConstants String feature) { private static @StringRes int getHelpTextForFeature(@FeatureConstants String feature) {
switch (feature) { switch (feature) {
case FeatureConstants.KEYBOARD_ACCESSORY_ADDRESS_FILL_FEATURE: case FeatureConstants.KEYBOARD_ACCESSORY_ADDRESS_FILL_FEATURE:
return R.string.iph_keyboard_accessory_fill_address;
case FeatureConstants.KEYBOARD_ACCESSORY_PASSWORD_FILLING_FEATURE: case FeatureConstants.KEYBOARD_ACCESSORY_PASSWORD_FILLING_FEATURE:
return R.string.iph_keyboard_accessory_fill_password;
case FeatureConstants.KEYBOARD_ACCESSORY_PAYMENT_FILLING_FEATURE: case FeatureConstants.KEYBOARD_ACCESSORY_PAYMENT_FILLING_FEATURE:
return R.string.iph_keyboard_accessory_fill_payment; return R.string.iph_keyboard_accessory_fill_with_chrome;
} }
assert false : "Unknown help text for feature: " + feature; assert false : "Unknown help text for feature: " + feature;
return 0; return 0;
......
...@@ -195,14 +195,8 @@ ...@@ -195,14 +195,8 @@
<message name="IDS_KEYBOARD_ACCESSORY_SHEET_HIDE" desc="Description for the active icon button that closes an accessory sheet and brings back the keyboard."> <message name="IDS_KEYBOARD_ACCESSORY_SHEET_HIDE" desc="Description for the active icon button that closes an accessory sheet and brings back the keyboard.">
Show keyboard Show keyboard
</message> </message>
<message name="IDS_IPH_KEYBOARD_ACCESSORY_FILL_ADDRESS" desc="Text in In-Product-Help bubble suggesting to fill a physical address with Chrome."> <message name="IDS_IPH_KEYBOARD_ACCESSORY_FILL_WITH_CHROME" desc="Text in In-Product-Help bubble suggesting to use an autofill suggestion provided by Chrome.">
Fill address Use Chrome autofill suggestion
</message>
<message name="IDS_IPH_KEYBOARD_ACCESSORY_FILL_PASSWORD" desc="Text in In-Product-Help bubble suggesting to fill a password with Chrome.">
Fill password
</message>
<message name="IDS_IPH_KEYBOARD_ACCESSORY_FILL_PAYMENT" desc="Text in In-Product-Help bubble suggesting to fill a credit card with Chrome.">
Fill payment method
</message> </message>
<message name="IDS_PASSWORD_GENERATION_ACCESSORY_BUTTON" desc="Text for the button used to generate a password."> <message name="IDS_PASSWORD_GENERATION_ACCESSORY_BUTTON" desc="Text for the button used to generate a password.">
Suggest strong password Suggest strong password
......
...@@ -262,7 +262,7 @@ public class KeyboardAccessoryModernViewTest { ...@@ -262,7 +262,7 @@ public class KeyboardAccessoryModernViewTest {
}); });
onViewWaiting(withText("Johnathan")); onViewWaiting(withText("Johnathan"));
waitForHelpBubble(withText(R.string.iph_keyboard_accessory_fill_password)); waitForHelpBubble(withText(R.string.iph_keyboard_accessory_fill_with_chrome));
onView(withChild(withText("Johnathan"))).check(matches(isSelected())); onView(withChild(withText("Johnathan"))).check(matches(isSelected()));
onView(withText("Johnathan")).perform(click()); onView(withText("Johnathan")).perform(click());
...@@ -290,7 +290,7 @@ public class KeyboardAccessoryModernViewTest { ...@@ -290,7 +290,7 @@ public class KeyboardAccessoryModernViewTest {
}); });
onViewWaiting(withText("Johnathan")); onViewWaiting(withText("Johnathan"));
waitForHelpBubble(withText(R.string.iph_keyboard_accessory_fill_address)); waitForHelpBubble(withText(R.string.iph_keyboard_accessory_fill_with_chrome));
onView(withText("Johnathan")).perform(click()); onView(withText("Johnathan")).perform(click());
assertThat(tracker.wasDismissed(), is(true)); assertThat(tracker.wasDismissed(), is(true));
...@@ -316,7 +316,7 @@ public class KeyboardAccessoryModernViewTest { ...@@ -316,7 +316,7 @@ public class KeyboardAccessoryModernViewTest {
}); });
onViewWaiting(withText("Johnathan")); onViewWaiting(withText("Johnathan"));
waitForHelpBubble(withText(R.string.iph_keyboard_accessory_fill_payment)); waitForHelpBubble(withText(R.string.iph_keyboard_accessory_fill_with_chrome));
onView(withText("Johnathan")).perform(click()); onView(withText("Johnathan")).perform(click());
assertThat(tracker.wasDismissed(), is(true)); assertThat(tracker.wasDismissed(), is(true));
......
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