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