Commit 88cc4cb3 authored by Tommy C. Li's avatar Tommy C. Li Committed by Commit Bot

Omnibox: Experiment with showing a generic icon for search suggestions

Instead of showing the Search Provider favicon in the omnibox, this
experiment shows a generic magnifying glass icon.

This also applies to the NTP, as the omnibox in the NTP has always had
the same icon as the omnibox showing a search suggestion.

Doing something different would require a more extensive change.

Bug: 931836
Change-Id: Ia16422b8e4c710b6d664d10c20a322b1083dd57a
Reviewed-on: https://chromium-review.googlesource.com/c/1471247Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Commit-Queue: Tommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632009}
parent e7fcc1a5
......@@ -58,6 +58,7 @@
#include "components/omnibox/browser/autocomplete_result.h"
#include "components/omnibox/browser/location_bar_model.h"
#include "components/omnibox/browser/omnibox_controller_emitter.h"
#include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/omnibox/browser/search_provider.h"
#include "components/prefs/pref_service.h"
#include "components/search/search.h"
......@@ -397,6 +398,13 @@ gfx::Image ChromeOmniboxClient::GetFaviconForPageUrl(
gfx::Image ChromeOmniboxClient::GetFaviconForDefaultSearchProvider(
FaviconFetchedCallback on_favicon_fetched) {
if (base::FeatureList::IsEnabled(
omnibox::kUIExperimentUseGenericSearchEngineIcon)) {
// Returning an empty image and never calling |on_favicon_fetched| will
// keep the generic icon showing for the default search provider.
return gfx::Image();
}
const TemplateURL* const default_provider =
GetTemplateURLService()->GetDefaultSearchProvider();
if (!default_provider)
......
......@@ -245,6 +245,12 @@ const base::Feature kUIExperimentShowSuffixOnAllSearchSuggestions{
"OmniboxUIExperimentShowSuffixOnAllSearchSuggestions",
base::FEATURE_DISABLED_BY_DEFAULT};
// Feature used to show a generic vector icon for omnibox search instead of the
// search engine favicon.
extern const base::Feature kUIExperimentUseGenericSearchEngineIcon{
"OminboxUIExperimentUseGenericSearchEngineIcon",
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.
......
......@@ -52,6 +52,7 @@ extern const base::Feature kUIExperimentShowSuggestionFavicons;
extern const base::Feature kUIExperimentSwapTitleAndUrl;
extern const base::Feature kUIExperimentVerticalMargin;
extern const base::Feature kUIExperimentShowSuffixOnAllSearchSuggestions;
extern const base::Feature kUIExperimentUseGenericSearchEngineIcon;
extern const base::Feature kSpeculativeServiceWorkerStartOnQueryInput;
extern const base::Feature kDocumentProvider;
extern const base::Feature kOmniboxPopupShortcutIconsInZeroState;
......
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