#include "components/omnibox/browser/zero_suggest_provider.h"
#include <stddef.h>
#include <optional>
#include <string>
#include <utility>
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/user_metrics.h"
#include "base/notreached.h"
#include "base/strings/escape.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "components/omnibox/browser/autocomplete_input.h"
#include "components/omnibox/browser/autocomplete_match.h"
#include "components/omnibox/browser/autocomplete_match_classification.h"
#include "components/omnibox/browser/autocomplete_provider_client.h"
#include "components/omnibox/browser/autocomplete_provider_debouncer.h"
#include "components/omnibox/browser/autocomplete_provider_listener.h"
#include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/omnibox/browser/omnibox_prefs.h"
#include "components/omnibox/browser/omnibox_triggered_feature_service.h"
#include "components/omnibox/browser/page_classification_functions.h"
#include "components/omnibox/browser/remote_suggestions_service.h"
#include "components/omnibox/browser/search_suggestion_parser.h"
#include "components/omnibox/browser/zero_suggest_cache_service.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/search_engines/search_engine_type.h"
#include "components/search_engines/template_url_service.h"
#include "components/url_formatter/url_formatter.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "third_party/metrics_proto/omnibox_event.pb.h"
#include "third_party/metrics_proto/omnibox_focus_type.pb.h"
#include "third_party/metrics_proto/omnibox_input_type.pb.h"
#include "url/gurl.h"
OEP;
OFT;
OIT;
namespace …
ZeroSuggestProvider::ResultType ZeroSuggestProvider::ResultTypeToRun(
const AutocompleteInput& input) { … }
ZeroSuggestProvider* ZeroSuggestProvider::Create(
AutocompleteProviderClient* client,
AutocompleteProviderListener* listener) { … }
void ZeroSuggestProvider::RegisterProfilePrefs(PrefRegistrySimple* registry) { … }
bool ZeroSuggestProvider::AllowZeroPrefixSuggestions(
const AutocompleteProviderClient* client,
const AutocompleteInput& input) { … }
void ZeroSuggestProvider::StartPrefetch(const AutocompleteInput& input) { … }
void ZeroSuggestProvider::RunZeroSuggestPrefetch(const AutocompleteInput& input,
const ResultType result_type) { … }
void ZeroSuggestProvider::Start(const AutocompleteInput& input,
bool minimal_changes) { … }
void ZeroSuggestProvider::Stop(bool clear_cached_results,
bool due_to_user_inactivity) { … }
void ZeroSuggestProvider::DeleteMatch(const AutocompleteMatch& match) { … }
void ZeroSuggestProvider::AddProviderInfo(ProvidersInfo* provider_info) const { … }
ZeroSuggestProvider::ZeroSuggestProvider(AutocompleteProviderClient* client,
AutocompleteProviderListener* listener)
: … { … }
ZeroSuggestProvider::~ZeroSuggestProvider() = default;
bool ZeroSuggestProvider::ShouldAppendExtraParams(
const SearchSuggestionParser::SuggestResult& result) const { … }
void ZeroSuggestProvider::RecordDeletionResult(bool success) { … }
void ZeroSuggestProvider::OnURLLoadComplete(
const AutocompleteInput& input,
const ResultType result_type,
const network::SimpleURLLoader* source,
const int response_code,
std::unique_ptr<std::string> response_body) { … }
void ZeroSuggestProvider::OnPrefetchURLLoadComplete(
const AutocompleteInput& input,
const ResultType result_type,
const network::SimpleURLLoader* source,
const int response_code,
std::unique_ptr<std::string> response_body) { … }
AutocompleteMatch ZeroSuggestProvider::NavigationToMatch(
const SearchSuggestionParser::NavigationResult& navigation) { … }
void ZeroSuggestProvider::ConvertSuggestResultsToAutocompleteMatches(
const SearchSuggestionParser::Results& results,
const AutocompleteInput& input) { … }