#include "components/omnibox/browser/local_history_zero_suggest_provider.h"
#include <algorithm>
#include <cmath>
#include <set>
#include <string>
#include <vector>
#include "base/check.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/i18n/case_conversion.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "base/timer/elapsed_timer.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "components/google/core/common/google_util.h"
#include "components/history/core/browser/history_database.h"
#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/keyword_search_term.h"
#include "components/history/core/browser/keyword_search_term_util.h"
#include "components/history/core/browser/url_database.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_listener.h"
#include "components/omnibox/browser/autocomplete_result.h"
#include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/omnibox/browser/omnibox_prefs.h"
#include "components/omnibox/browser/page_classification_functions.h"
#include "components/omnibox/browser/zero_suggest_provider.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/search/search.h"
#include "components/search_engines/template_url_service.h"
#include "third_party/metrics_proto/omnibox_focus_type.pb.h"
#include "third_party/omnibox_proto/navigational_intent.pb.h"
#include "url/gurl.h"
OmniboxInputType;
namespace {
std::u16string GetSearchTermsFromURL(const GURL& url,
TemplateURLService* template_url_service) { … }
bool AllowLocalHistoryZeroSuggestSuggestions(AutocompleteProviderClient* client,
const AutocompleteInput& input) { … }
}
LocalHistoryZeroSuggestProvider* LocalHistoryZeroSuggestProvider::Create(
AutocompleteProviderClient* client,
AutocompleteProviderListener* listener) { … }
void LocalHistoryZeroSuggestProvider::Start(const AutocompleteInput& input,
bool minimal_changes) { … }
void LocalHistoryZeroSuggestProvider::DeleteMatch(
const AutocompleteMatch& match) { … }
LocalHistoryZeroSuggestProvider::LocalHistoryZeroSuggestProvider(
AutocompleteProviderClient* client,
AutocompleteProviderListener* listener)
: … { … }
LocalHistoryZeroSuggestProvider::~LocalHistoryZeroSuggestProvider() { … }
void LocalHistoryZeroSuggestProvider::QueryURLDatabase(
const AutocompleteInput& input) { … }
void LocalHistoryZeroSuggestProvider::OnHistoryQueryResults(
const std::u16string& suggestion,
const base::TimeTicks& query_time,
history::QueryResults results) { … }