hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 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. |
| 4 | |
Ryo Hashimoto | 884ad19 | 2014-08-28 05:54:30 | [diff] [blame] | 5 | #ifndef CHROME_BROWSER_AUTOCOMPLETE_CHROME_AUTOCOMPLETE_PROVIDER_CLIENT_H_ |
| 6 | #define CHROME_BROWSER_AUTOCOMPLETE_CHROME_AUTOCOMPLETE_PROVIDER_CLIENT_H_ |
hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 7 | |
avi | e4d7b6f | 2015-12-26 00:59:18 | [diff] [blame] | 8 | #include "base/macros.h" |
hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 9 | #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" |
blundell | 0c5bb253 | 2015-06-16 14:23:14 | [diff] [blame] | 10 | #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" |
blundell | 2102f7c | 2015-07-09 10:00:53 | [diff] [blame] | 11 | #include "components/omnibox/browser/autocomplete_provider_client.h" |
hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 12 | |
| 13 | class Profile; |
| 14 | |
Ryo Hashimoto | 884ad19 | 2014-08-28 05:54:30 | [diff] [blame] | 15 | class ChromeAutocompleteProviderClient : public AutocompleteProviderClient { |
hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 16 | public: |
Ryo Hashimoto | 884ad19 | 2014-08-28 05:54:30 | [diff] [blame] | 17 | explicit ChromeAutocompleteProviderClient(Profile* profile); |
Daniel Cheng | a542fca | 2014-10-21 09:51:29 | [diff] [blame] | 18 | ~ChromeAutocompleteProviderClient() override; |
hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 19 | |
Ryo Hashimoto | 884ad19 | 2014-08-28 05:54:30 | [diff] [blame] | 20 | // AutocompleteProviderClient: |
paulmeyer | b582426 | 2015-06-17 18:08:44 | [diff] [blame] | 21 | net::URLRequestContextGetter* GetRequestContext() override; |
blundell | d130d59 | 2015-06-21 19:29:13 | [diff] [blame] | 22 | PrefService* GetPrefs() override; |
| 23 | const AutocompleteSchemeClassifier& GetSchemeClassifier() const override; |
| 24 | AutocompleteClassifier* GetAutocompleteClassifier() override; |
paulmeyer | b582426 | 2015-06-17 18:08:44 | [diff] [blame] | 25 | history::HistoryService* GetHistoryService() override; |
blundell | d130d59 | 2015-06-21 19:29:13 | [diff] [blame] | 26 | scoped_refptr<history::TopSites> GetTopSites() override; |
paulmeyer | b582426 | 2015-06-17 18:08:44 | [diff] [blame] | 27 | bookmarks::BookmarkModel* GetBookmarkModel() override; |
| 28 | history::URLDatabase* GetInMemoryDatabase() override; |
blundell | b11c2787e | 2015-06-22 10:05:10 | [diff] [blame] | 29 | InMemoryURLIndex* GetInMemoryURLIndex() override; |
blundell | 0c5bb253 | 2015-06-16 14:23:14 | [diff] [blame] | 30 | TemplateURLService* GetTemplateURLService() override; |
blundell | d130d59 | 2015-06-21 19:29:13 | [diff] [blame] | 31 | const TemplateURLService* GetTemplateURLService() const override; |
| 32 | const SearchTermsData& GetSearchTermsData() const override; |
blundell | fb1215ee | 2015-06-19 20:18:12 | [diff] [blame] | 33 | scoped_refptr<ShortcutsBackend> GetShortcutsBackend() override; |
| 34 | scoped_refptr<ShortcutsBackend> GetShortcutsBackendIfExists() override; |
dcheng | 4af4858 | 2016-04-19 00:29:35 | [diff] [blame^] | 35 | std::unique_ptr<KeywordExtensionsDelegate> GetKeywordExtensionsDelegate( |
blundell | b11c2787e | 2015-06-22 10:05:10 | [diff] [blame] | 36 | KeywordProvider* keyword_provider) override; |
blundell | d130d59 | 2015-06-21 19:29:13 | [diff] [blame] | 37 | std::string GetAcceptLanguages() const override; |
blundell | ff1502c | 2015-06-22 11:34:37 | [diff] [blame] | 38 | std::string GetEmbedderRepresentationOfAboutScheme() override; |
| 39 | std::vector<base::string16> GetBuiltinURLs() override; |
| 40 | std::vector<base::string16> GetBuiltinsToProvideAsUserTypes() override; |
blundell | d130d59 | 2015-06-21 19:29:13 | [diff] [blame] | 41 | bool IsOffTheRecord() const override; |
| 42 | bool SearchSuggestEnabled() const override; |
blundell | d130d59 | 2015-06-21 19:29:13 | [diff] [blame] | 43 | bool TabSyncEnabledAndUnencrypted() const override; |
Daniel Cheng | a542fca | 2014-10-21 09:51:29 | [diff] [blame] | 44 | void Classify( |
hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 45 | const base::string16& text, |
| 46 | bool prefer_keyword, |
| 47 | bool allow_exact_keyword_match, |
| 48 | metrics::OmniboxEventProto::PageClassification page_classification, |
| 49 | AutocompleteMatch* match, |
mostynb | 01d8b10e | 2014-10-13 09:44:44 | [diff] [blame] | 50 | GURL* alternate_nav_url) override; |
Daniel Cheng | a542fca | 2014-10-21 09:51:29 | [diff] [blame] | 51 | void DeleteMatchingURLsForKeywordFromHistory( |
hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 52 | history::KeywordID keyword_id, |
mostynb | 01d8b10e | 2014-10-13 09:44:44 | [diff] [blame] | 53 | const base::string16& term) override; |
Daniel Cheng | a542fca | 2014-10-21 09:51:29 | [diff] [blame] | 54 | void PrefetchImage(const GURL& url) override; |
blundell | 62bf65f | 2015-06-19 08:30:46 | [diff] [blame] | 55 | void OnAutocompleteControllerResultReady( |
| 56 | AutocompleteController* controller) override; |
hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 57 | |
| 58 | private: |
| 59 | Profile* profile_; |
| 60 | ChromeAutocompleteSchemeClassifier scheme_classifier_; |
blundell | 0c5bb253 | 2015-06-16 14:23:14 | [diff] [blame] | 61 | UIThreadSearchTermsData search_terms_data_; |
hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 62 | |
Ryo Hashimoto | 884ad19 | 2014-08-28 05:54:30 | [diff] [blame] | 63 | DISALLOW_COPY_AND_ASSIGN(ChromeAutocompleteProviderClient); |
hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 64 | }; |
| 65 | |
Ryo Hashimoto | 884ad19 | 2014-08-28 05:54:30 | [diff] [blame] | 66 | #endif // CHROME_BROWSER_AUTOCOMPLETE_CHROME_AUTOCOMPLETE_PROVIDER_CLIENT_H_ |