Commit 6a43dad7 authored by Kevin Bailey's avatar Kevin Bailey Committed by Commit Bot

[omnibox] Add another official string for tab switch button

Add the other official string - the shortened version of the
wider button label - and have the tab switch button use it.

Bug: 780835
Change-Id: I51aed2d19a9abd15b613e29becb929b1aa483a07
Reviewed-on: https://chromium-review.googlesource.com/1069255Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Commit-Queue: Kevin Bailey <krb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560770}
parent a95a56bc
......@@ -36,7 +36,7 @@ OmniboxTabSwitchButton::OmniboxTabSwitchButton(OmniboxPopupContentsView* model,
SK_ColorBLACK));
if (!calculated_widths_) {
icon_only_width_ = MdTextButton::CalculatePreferredSize().width();
SetText(base::ASCIIToUTF16("Switch"));
SetText(l10n_util::GetStringUTF16(IDS_OMNIBOX_TAB_SUGGEST_SHORT_HINT));
short_text_width_ = MdTextButton::CalculatePreferredSize().width();
SetText(l10n_util::GetStringUTF16(IDS_OMNIBOX_TAB_SUGGEST_HINT));
full_text_width_ = MdTextButton::CalculatePreferredSize().width();
......@@ -53,7 +53,7 @@ void OmniboxTabSwitchButton::ProvideWidthHint(size_t parent_width) {
if (full_text_width_ < parent_width / 5) {
SetText(l10n_util::GetStringUTF16(IDS_OMNIBOX_TAB_SUGGEST_HINT));
} else if (short_text_width_ < parent_width / 5) {
SetText(base::ASCIIToUTF16("Switch"));
SetText(l10n_util::GetStringUTF16(IDS_OMNIBOX_TAB_SUGGEST_SHORT_HINT));
} else if (icon_only_width_ < parent_width / 5) {
SetText(base::ASCIIToUTF16(""));
} else {
......
......@@ -40,9 +40,12 @@
Search or type URL
</message>
</if>
<message name="IDS_OMNIBOX_TAB_SUGGEST_HINT" desc="The text prefixing a suggestion description to say that this suggestion will switch to another tab.">
<message name="IDS_OMNIBOX_TAB_SUGGEST_HINT" desc="The button text contents to say that this suggestion will switch to another tab.">
Switch to this tab
</message>
<message name="IDS_OMNIBOX_TAB_SUGGEST_SHORT_HINT" desc="A shortened, one word version of button text to say that this suggestion will switch to another tab.">
Switch
</message>
<message name="IDS_PHYSICAL_WEB_OVERFLOW_DESCRIPTION" desc="The description in the omnibox dropdown indicating that multiple nearby devices are broadcasting URLs.">
Physical Web suggestions
</message>
......
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