Commit 7af8664b authored by Tommy C. Li's avatar Tommy C. Li Committed by Commit Bot

[omnibox] Implement OmniboxAlternateMatchDescriptionSeparator flag.

This adds a OmniboxAlternateMatchDescriptionSeparator feature flag. In
the default locale, it replaces the '-' separator between the match
contents and description with a '|' separator.

Bug: 955585
Change-Id: I98253872642e89727fe3a0b29c18caf77ca94a8f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1580101Reviewed-by: default avatarOrin Jaworski <orinj@chromium.org>
Commit-Queue: Tommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653662}
parent 308a6faa
......@@ -1188,6 +1188,10 @@ are declared in tools/grit/grit_rule.gni.
<message name="IDS_AUTOCOMPLETE_MATCH_DESCRIPTION_SEPARATOR" desc="The separator between a result in the autocomplete popup and its description.">
''' - '''
</message>
<message name="IDS_AUTOCOMPLETE_MATCH_DESCRIPTION_SEPARATOR_ALTERNATE"
desc="An experimental separator used in the autocomplete popup instead of IDS_AUTOCOMPLETE_MATCH_DESCRIPTION_SEPARATOR if an experimental flag is on.">
''' | '''
</message>
<if expr="not use_titlecase">
<message name="IDS_EDIT_SEARCH_ENGINES"
desc="Title of the popup menu item for editing search engines">
......
5593061efaa974c571e25dab47b85428789a512b
\ No newline at end of file
......@@ -202,8 +202,11 @@ OmniboxMatchCellView::OmniboxMatchCellView(OmniboxResultView* result_view) {
answer_image_view_->SetHorizontalAlignment(views::ImageView::CENTER);
answer_image_view_->SetVerticalAlignment(views::ImageView::CENTER);
const base::string16& separator =
l10n_util::GetStringUTF16(IDS_AUTOCOMPLETE_MATCH_DESCRIPTION_SEPARATOR);
const base::string16 separator = l10n_util::GetStringUTF16(
base::FeatureList::IsEnabled(
omnibox::kOmniboxAlternateMatchDescriptionSeparator)
? IDS_AUTOCOMPLETE_MATCH_DESCRIPTION_SEPARATOR_ALTERNATE
: IDS_AUTOCOMPLETE_MATCH_DESCRIPTION_SEPARATOR);
separator_view_->SetText(separator);
}
......
......@@ -123,6 +123,12 @@ const base::Feature kOmniboxSuggestionTransparencyOptions{
const base::Feature kOmniboxUICuesForSearchHistoryMatches{
"OmniboxUICuesForSearchHistoryMatches", base::FEATURE_DISABLED_BY_DEFAULT};
// Feature that shows an alternate separator before the description of
// omnibox matches. In English, this changes the separator from '-' to '|'.
const base::Feature kOmniboxAlternateMatchDescriptionSeparator{
"OmniboxAlternateMatchDescriptionSeparator",
base::FEATURE_DISABLED_BY_DEFAULT};
// Feature to enable clipboard provider to suggest copied text.
const base::Feature kEnableClipboardProviderTextSuggestions{
"OmniboxEnableClipboardProviderTextSuggestions",
......
......@@ -26,6 +26,7 @@ extern const base::Feature kExperimentalKeywordMode;
extern const base::Feature kOmniboxPedalSuggestions;
extern const base::Feature kOmniboxSuggestionTransparencyOptions;
extern const base::Feature kOmniboxUICuesForSearchHistoryMatches;
extern const base::Feature kOmniboxAlternateMatchDescriptionSeparator;
extern const base::Feature kEnableClipboardProviderTextSuggestions;
extern const base::Feature kEnableClipboardProviderImageSuggestions;
extern const base::Feature kSearchProviderWarmUpOnFocus;
......
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