From: csagan5 <32685696+csagan5@users.noreply.github.com> Date: Sun, 27 Oct 2019 10:21:19 +0100 Subject: Disable requests for single-word Omnibar searches Patch from https://github.com/Eloston/ungoogled-chromium/issues/814#issuecomment-526873727 License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- .../ui/omnibox/chrome_omnibox_navigation_observer.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc --- a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc +++ b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc @@ -76,6 +76,7 @@ bool OnlyChangeIsFromHTTPToHTTPS(const GURL& origin, const GURL& destination) { return origin_with_https == destination; } +#if BUILDFLAG(IS_ANDROID) // Choose the appropriate URLLoaderFactory: either an explicitly specified or a // default for the given profile. network::mojom::URLLoaderFactory* GetURLLoaderFactory( @@ -87,6 +88,7 @@ network::mojom::URLLoaderFactory* GetURLLoaderFactory( ->GetURLLoaderFactoryForBrowserProcess() .get(); } +#endif // Helper to keep ChromeOmniboxNavigationObserver alive while the initiated // navigation is pending. @@ -252,13 +254,6 @@ ChromeOmniboxNavigationObserver::ChromeOmniboxNavigationObserver( profile_(profile), show_infobar_(std::move(show_infobar)) { NavigationUserData::CreateForNavigationHandle(navigation, this); - if (alternative_nav_match_.destination_url.is_valid()) { - loader_ = std::make_unique( - alternative_nav_match.destination_url, this, - base::BindOnce( - &ChromeOmniboxNavigationObserver::OnAlternativeLoaderDone, this), - GetURLLoaderFactory(loader_factory, profile)); - } } ChromeOmniboxNavigationObserver::~ChromeOmniboxNavigationObserver() { -- 2.25.1