Commit 0503893b authored by Mei Liang's avatar Mei Liang Committed by Commit Bot

Add accessibility strings for tab groups feature IPHs

This CL adds accessibility strings for tab group feature IPHs and
updates tab groups related strings description according to the spec.

Bug: 938522
Change-Id: I7efec5e3eeedb76135975ceb30dc3077d70a9439
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504162
Commit-Queue: Mei Liang <meiliang@chromium.org>
Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638423}
parent 2c9819fd
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
style="@style/BottomToolbarButton" style="@style/BottomToolbarButton"
android:src="@drawable/ic_expand_more_black_24dp" android:src="@drawable/ic_expand_more_black_24dp"
app:tint="@color/standard_mode_tint" app:tint="@color/standard_mode_tint"
android:contentDescription="@string/accessibility_collapse_section_header" /> android:contentDescription="@string/accessibility_bottom_tab_grid_close_tab_sheet" />
<TextView <TextView
android:id="@+id/title" android:id="@+id/title"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
style="@style/BottomToolbarButton" style="@style/BottomToolbarButton"
android:src="@drawable/ic_expand_less_black_24dp" android:src="@drawable/ic_expand_less_black_24dp"
app:tint="@color/standard_mode_tint" app:tint="@color/standard_mode_tint"
android:contentDescription="@string/accessibility_expand_section_header" /> android:contentDescription="@string/accessibility_bottom_tab_strip_expand_tab_sheet" />
<FrameLayout <FrameLayout
android:id="@+id/toolbar_container_view" android:id="@+id/toolbar_container_view"
android:layout_width="0dp" android:layout_width="0dp"
......
...@@ -32,15 +32,21 @@ public class TabGroupUtils { ...@@ -32,15 +32,21 @@ public class TabGroupUtils {
@StringRes @StringRes
int textId; int textId;
@StringRes
int accessibilityTextId;
switch (featureName) { switch (featureName) {
case FeatureConstants.TAB_GROUPS_QUICKLY_COMPARE_PAGES_FEATURE: case FeatureConstants.TAB_GROUPS_QUICKLY_COMPARE_PAGES_FEATURE:
textId = R.string.iph_tab_groups_quickly_compare_pages_text; textId = R.string.iph_tab_groups_quickly_compare_pages_text;
accessibilityTextId = textId;
break; break;
case FeatureConstants.TAB_GROUPS_TAP_TO_SEE_ANOTHER_TAB_FEATURE: case FeatureConstants.TAB_GROUPS_TAP_TO_SEE_ANOTHER_TAB_FEATURE:
textId = R.string.iph_tab_groups_tap_to_see_another_tab_text; textId = R.string.iph_tab_groups_tap_to_see_another_tab_text;
accessibilityTextId =
R.string.iph_tab_groups_tap_to_see_another_tab_accessibility_text;
break; break;
case FeatureConstants.TAB_GROUPS_YOUR_TABS_ARE_TOGETHER_FEATURE: case FeatureConstants.TAB_GROUPS_YOUR_TABS_ARE_TOGETHER_FEATURE:
textId = R.string.iph_tab_groups_your_tabs_together_text; textId = R.string.iph_tab_groups_your_tabs_together_text;
accessibilityTextId = textId;
break; break;
default: default:
assert false; assert false;
...@@ -53,8 +59,8 @@ public class TabGroupUtils { ...@@ -53,8 +59,8 @@ public class TabGroupUtils {
ViewRectProvider rectProvider = new ViewRectProvider(view); ViewRectProvider rectProvider = new ViewRectProvider(view);
TextBubble textBubble = TextBubble textBubble = new TextBubble(
new TextBubble(view.getContext(), view, textId, textId, true, rectProvider); view.getContext(), view, textId, accessibilityTextId, true, rectProvider);
textBubble.setDismissOnTouchInteraction(true); textBubble.setDismissOnTouchInteraction(true);
textBubble.addOnDismissListener(() -> tracker.dismissed(featureName)); textBubble.addOnDismissListener(() -> tracker.dismissed(featureName));
textBubble.show(); textBubble.show();
......
...@@ -41,14 +41,19 @@ class TabStripViewBinder { ...@@ -41,14 +41,19 @@ class TabStripViewBinder {
R.drawable.selected_tab_background, R.drawable.selected_tab_background,
holder.itemView.getContext().getTheme()) holder.itemView.getContext().getTheme())
: null); : null);
String title = item.get(TabProperties.TITLE);
if (item.get(TabProperties.IS_SELECTED)) { if (item.get(TabProperties.IS_SELECTED)) {
holder.button.setOnClickListener(view -> { holder.button.setOnClickListener(view -> {
item.get(TabProperties.TAB_CLOSED_LISTENER).run(holder.getTabId()); item.get(TabProperties.TAB_CLOSED_LISTENER).run(holder.getTabId());
}); });
holder.button.setContentDescription(holder.itemView.getContext().getString(
R.string.accessibility_tabstrip_btn_close_tab, title));
} else { } else {
holder.button.setOnClickListener(view -> { holder.button.setOnClickListener(view -> {
item.get(TabProperties.TAB_SELECTED_LISTENER).run(holder.getTabId()); item.get(TabProperties.TAB_SELECTED_LISTENER).run(holder.getTabId());
}); });
holder.button.setContentDescription(holder.itemView.getContext().getString(
R.string.accessibility_tabstrip_tab, title));
} }
} else if (TabProperties.FAVICON == propertyKey) { } else if (TabProperties.FAVICON == propertyKey) {
Bitmap favicon = item.get(TabProperties.FAVICON); Bitmap favicon = item.get(TabProperties.FAVICON);
......
...@@ -3877,13 +3877,16 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p ...@@ -3877,13 +3877,16 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_IPH_PREVIEWS_OMNIBOX_UI_ACCESSIBILITY_TEXT" desc="The in-product-help text informing the user that the displayed page was modified to make it load faster or use less data. Prompts the user to tap the message and load the original, unaltered, page if they would like. The 'Lite page provided by Google.' sentence should match TC ID 373879247902731825"> <message name="IDS_IPH_PREVIEWS_OMNIBOX_UI_ACCESSIBILITY_TEXT" desc="The in-product-help text informing the user that the displayed page was modified to make it load faster or use less data. Prompts the user to tap the message and load the original, unaltered, page if they would like. The 'Lite page provided by Google.' sentence should match TC ID 373879247902731825">
Lite page provided by Google. Tap the load original button to load the original page. Lite page provided by Google. Tap the load original button to load the original page.
</message> </message>
<message name="IDS_IPH_TAB_GROUPS_QUICKLY_COMPARE_PAGES_TEXT" desc="In-product help for prompting the user on pages with links to long press and open links in different tabs."> <message name="IDS_IPH_TAB_GROUPS_QUICKLY_COMPARE_PAGES_TEXT" desc="When Chrome detects that the user is searching or comparing multiple pages (e.g. while comparison shopping), this in-product help text appears at the bottom of the screen. The text informs the user that they can longpress on a link to open it as a new tab within a tab group.">
Quickly compare pages by making a group. To start, touch &amp; hold a link. Quickly compare pages by making a group. To start, touch &amp; hold a link.
</message> </message>
<message name="IDS_IPH_TAB_GROUPS_TAP_TO_SEE_ANOTHER_TAB_TEXT" desc="In-product help for when the tab strip containing the tabs in a tab group are shown."> <message name="IDS_IPH_TAB_GROUPS_TAP_TO_SEE_ANOTHER_TAB_ACCESSIBILITY_TEXT" desc="This in-product help accessibility text points to the strip of favicons at the bottom of the page. The favicons indicate all the open tabs within the tab group. The text informs the user that they can tap on any favicon to switch to that tab.">
Switch between tabs in your tab group near bottom of screen
</message>
<message name="IDS_IPH_TAB_GROUPS_TAP_TO_SEE_ANOTHER_TAB_TEXT" desc="This in-product help text points to the strip of favicons at the bottom of the page. The favicons indicate all the open tabs within the tab group. The text informs the user that they can tap on any favicon to switch to that tab.">
Tap to see another tab Tap to see another tab
</message> </message>
<message name="IDS_IPH_TAB_GROUPS_YOUR_TABS_TOGETHER_TEXT" desc="In-product help for when a tab switcher card with multiple thumbnails are shown."> <message name="IDS_IPH_TAB_GROUPS_YOUR_TABS_TOGETHER_TEXT" desc="This in-product help text points to a group of tabs within the Tab Switcher. The text informs the user that they can find existing tab groups in the Tab Switcher.">
Your tabs are grouped together here Your tabs are grouped together here
</message> </message>
<message name="IDS_IPH_TRANSLATE_MENU_BUTTON_TEXT" desc="The in-product-help message after a successful navigation prompting user to translate current page."> <message name="IDS_IPH_TRANSLATE_MENU_BUTTON_TEXT" desc="The in-product-help message after a successful navigation prompting user to translate current page.">
...@@ -4070,7 +4073,16 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p ...@@ -4070,7 +4073,16 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
</message> </message>
<message name="IDS_BOTTOM_TAB_GRID_NEW_TAB" desc="Accessibility string for BottomTabGridToolbar option 'create new tab in group' indicated visually by the '+' sign."> <message name="IDS_BOTTOM_TAB_GRID_NEW_TAB" desc="Accessibility string for BottomTabGridToolbar option 'create new tab in group' indicated visually by the '+' sign.">
Create new tab in group Add new tab to group
</message>
<message name="IDS_ACCESSIBILITY_BOTTOM_TAB_GRID_CLOSE_TAB_SHEET" desc="Accessibility string for BottomTabGridToolbar button indicated visually by the 'v' sign.">
Hide fullscreen grid
</message>
<!-- Bottom Tab Strip strings -->
<message name="IDS_ACCESSIBILITY_BOTTOM_TAB_STRIP_EXPAND_TAB_SHEET" desc="Accessibility string for BottomTabStripToolbar button indicated visually by the '^' sign.">
Show group's tabs in fullscreen grid
</message> </message>
</messages> </messages>
</release> </release>
......
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