// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // This file contains the Search autocomplete provider. This provider is // responsible for all autocomplete entries that start with "Search <engine> // for ...", including searching for the current input string, search // history, and search suggestions. An instance of it gets created and // managed by the autocomplete controller. #ifndef COMPONENTS_OMNIBOX_BROWSER_SEARCH_PROVIDER_H_ #define COMPONENTS_OMNIBOX_BROWSER_SEARCH_PROVIDER_H_ #include <memory> #include <string> #include <vector> #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" #include "base/memory/raw_ptr.h" #include "base/scoped_observation.h" #include "base/time/time.h" #include "base/timer/timer.h" #include "components/omnibox/browser/answers_cache.h" #include "components/omnibox/browser/base_search_provider.h" #include "components/search_engines/template_url.h" #include "components/search_engines/template_url_service.h" #include "components/search_engines/template_url_service_observer.h" #include "third_party/metrics_proto/omnibox_input_type.pb.h" class AutocompleteProviderClient; class AutocompleteProviderListener; class AutocompleteResult; class SearchProviderTest; namespace history { struct KeywordSearchTermVisit; } namespace network { class SimpleURLLoader; } // Autocomplete provider for searches and suggestions from a search engine. // // After construction, the autocomplete controller repeatedly calls Start() // with some user input, each time expecting to receive a small set of the best // matches (either synchronously or asynchronously). // // Initially the provider creates a match that searches for the current input // text. It also starts a task to query the Suggest servers. When that data // comes back, the provider creates and returns matches for the best // suggestions. class SearchProvider : public BaseSearchProvider, public TemplateURLServiceObserver { … }; #endif // COMPONENTS_OMNIBOX_BROWSER_SEARCH_PROVIDER_H_