1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_CLIENT_H_
6 #define COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_CLIENT_H_
8 #include "base/strings/string16.h"
9 #include "components/history/core/browser/keyword_id.h"
10 #include "components/metrics/proto/omnibox_event.pb.h"
12 struct AutocompleteMatch
;
13 class AutocompleteSchemeClassifier
;
26 class URLRequestContextGetter
;
29 class SearchTermsData
;
30 class TemplateURLService
;
32 class AutocompleteProviderClient
{
34 virtual ~AutocompleteProviderClient() {}
36 virtual net::URLRequestContextGetter
* GetRequestContext() = 0;
37 virtual const AutocompleteSchemeClassifier
& GetSchemeClassifier() = 0;
38 virtual history::HistoryService
* GetHistoryService() = 0;
39 virtual bookmarks::BookmarkModel
* GetBookmarkModel() = 0;
40 virtual history::URLDatabase
* GetInMemoryDatabase() = 0;
41 virtual TemplateURLService
* GetTemplateURLService() = 0;
42 virtual const SearchTermsData
& GetSearchTermsData() = 0;
44 // The value to use for Accept-Languages HTTP header when making an HTTP
46 virtual std::string
GetAcceptLanguages() = 0;
48 virtual bool IsOffTheRecord() = 0;
49 virtual bool SearchSuggestEnabled() = 0;
51 // Returns whether the bookmark bar is visible on all tabs.
52 virtual bool ShowBookmarkBar() = 0;
54 virtual bool TabSyncEnabledAndUnencrypted() = 0;
56 // Given some string |text| that the user wants to use for navigation,
57 // determines how it should be interpreted.
58 virtual void Classify(
59 const base::string16
& text
,
61 bool allow_exact_keyword_match
,
62 metrics::OmniboxEventProto::PageClassification page_classification
,
63 AutocompleteMatch
* match
,
64 GURL
* alternate_nav_url
) = 0;
66 // Deletes all URL and search term entries matching the given |term| and
67 // |keyword_id| from history.
68 virtual void DeleteMatchingURLsForKeywordFromHistory(
69 history::KeywordID keyword_id
,
70 const base::string16
& term
) = 0;
72 virtual void PrefetchImage(const GURL
& url
) = 0;
75 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_CLIENT_H_