#include "chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h"
#include "base/functional/bind.h"
#include "base/trace_event/typed_macros.h"
#include "chrome/browser/autocomplete/shortcuts_backend_factory.h"
#include "chrome/browser/intranet_redirect_detector.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.h"
#include "chrome/browser/ui/omnibox/chrome_omnibox_client.h"
#include "components/infobars/content/content_infobar_manager.h"
#include "components/omnibox/browser/shortcuts_backend.h"
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_service.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/navigation_handle_user_data.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "net/base/load_flags.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "url/gurl.h"
#include "url/url_constants.h"
class ChromeOmniboxNavigationObserver;
namespace …
class ChromeOmniboxNavigationObserver::AlternativeNavigationURLLoader { … };
ChromeOmniboxNavigationObserver::ChromeOmniboxNavigationObserver(
content::NavigationHandle& navigation,
Profile* profile,
const std::u16string& text,
const AutocompleteMatch& match,
const AutocompleteMatch& alternative_nav_match,
network::mojom::URLLoaderFactory* loader_factory,
ShowInfobarCallback show_infobar)
: … { … }
ChromeOmniboxNavigationObserver::~ChromeOmniboxNavigationObserver() { … }
void ChromeOmniboxNavigationObserver::DidFinishNavigation(
content::NavigationHandle* navigation_handle) { … }
void ChromeOmniboxNavigationObserver::On404() { … }
void ChromeOmniboxNavigationObserver::OnAlternativeLoaderDone(bool success) { … }
void ChromeOmniboxNavigationObserver::ShowAlternativeNavInfoBar() { … }
void ChromeOmniboxNavigationObserver::Create(
content::NavigationHandle* navigation,
Profile* profile,
const std::u16string& text,
const AutocompleteMatch& match,
const AutocompleteMatch& alternative_nav_match) { … }
void ChromeOmniboxNavigationObserver::CreateForTesting(
content::NavigationHandle* navigation,
Profile* profile,
const std::u16string& text,
const AutocompleteMatch& match,
const AutocompleteMatch& alternative_nav_match,
network::mojom::URLLoaderFactory* loader_factory,
ShowInfobarCallback show_infobar) { … }