Commit 9453dc9f authored by Orin Jaworski's avatar Orin Jaworski Committed by Commit Bot

[omnibox] Add flag, OmniboxUIExperimentUnboldSuggestionText

This CL adds a feature flag to experiment with unbolding
suggestion text in the omnibox.

Bug: 931332
Change-Id: I7ef5ced1a1e86f46e37e1695c7b3d20558e58b3c
Reviewed-on: https://chromium-review.googlesource.com/c/1475746Reviewed-by: default avatarKevin Bailey <krb@chromium.org>
Commit-Queue: Orin Jaworski <orinj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632742}
parent 00c5639d
......@@ -99,6 +99,10 @@ void ApplyTextStyleForType(SuggestionAnswer::TextStyle text_style,
case SuggestionAnswer::TextStyle::BOLD:
style = {part_color, .baseline = gfx::NORMAL_BASELINE,
.weight = gfx::Font::Weight::BOLD};
if (base::FeatureList::IsEnabled(
omnibox::kUIExperimentUnboldSuggestionText)) {
style.weight = gfx::Font::Weight::NORMAL;
}
break;
case SuggestionAnswer::TextStyle::NORMAL:
case SuggestionAnswer::TextStyle::NORMAL_DIM:
......@@ -258,9 +262,12 @@ void OmniboxTextView::ReapplyStyling() {
: text_length;
const gfx::Range current_range(text_start, text_end);
// Calculate style-related data.
if (classifications[i].style & ACMatchClassification::MATCH)
render_text_->ApplyWeight(gfx::Font::Weight::BOLD, current_range);
if (!base::FeatureList::IsEnabled(
omnibox::kUIExperimentUnboldSuggestionText)) {
// Calculate style-related data.
if (classifications[i].style & ACMatchClassification::MATCH)
render_text_->ApplyWeight(gfx::Font::Weight::BOLD, current_range);
}
OmniboxPart part = OmniboxPart::RESULTS_TEXT_DEFAULT;
if (classifications[i].style & ACMatchClassification::URL) {
......
......@@ -246,6 +246,11 @@ extern const base::Feature kUIExperimentUseGenericSearchEngineIcon{
"OminboxUIExperimentUseGenericSearchEngineIcon",
base::FEATURE_DISABLED_BY_DEFAULT};
// Feature used to unbold suggestion text.
const base::Feature kUIExperimentUnboldSuggestionText{
"OmniboxUIExperimentUnboldSuggestionText",
base::FEATURE_DISABLED_BY_DEFAULT};
// Feature used to enable speculatively starting a service worker associated
// with the destination of the default match when the user's input looks like a
// query.
......
......@@ -54,6 +54,7 @@ extern const base::Feature kUIExperimentVerticalMargin;
extern const base::Feature kUIExperimentShowSuffixOnAllSearchSuggestions;
extern const base::Feature kUIExperimentWhiteBackgroundOnBlur;
extern const base::Feature kUIExperimentUseGenericSearchEngineIcon;
extern const base::Feature kUIExperimentUnboldSuggestionText;
extern const base::Feature kSpeculativeServiceWorkerStartOnQueryInput;
extern const base::Feature kDocumentProvider;
extern const base::Feature kDedupeGoogleDriveURLs;
......
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