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: |
Daniel Cheng | a542fca | 2014-10-21 09:51:29 | [diff] [blame] | 20 | net::URLRequestContextGetter* RequestContext() override; |
Daniel Cheng | a542fca | 2014-10-21 09:51:29 | [diff] [blame] | 21 | const AutocompleteSchemeClassifier& SchemeClassifier() override; |
blundell | 55e35e8 | 2015-06-16 08:46:18 | [diff] [blame] | 22 | history::HistoryService* HistoryService() override; |
| 23 | bookmarks::BookmarkModel* BookmarkModel() override; |
blundell | 2785597 | 2015-06-16 12:37:54 | [diff] [blame] | 24 | history::URLDatabase* InMemoryDatabase() override; |
blundell | 0c5bb253 | 2015-06-16 14:23:14 | [diff] [blame^] | 25 | TemplateURLService* GetTemplateURLService() override; |
| 26 | const SearchTermsData& GetSearchTermsData() override; |
blundell | 2785597 | 2015-06-16 12:37:54 | [diff] [blame] | 27 | std::string AcceptLanguages() override; |
| 28 | bool IsOffTheRecord() override; |
| 29 | bool SearchSuggestEnabled() override; |
| 30 | bool ShowBookmarkBar() override; |
| 31 | bool TabSyncEnabledAndUnencrypted() override; |
Daniel Cheng | a542fca | 2014-10-21 09:51:29 | [diff] [blame] | 32 | void Classify( |
hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 33 | const base::string16& text, |
| 34 | bool prefer_keyword, |
| 35 | bool allow_exact_keyword_match, |
| 36 | metrics::OmniboxEventProto::PageClassification page_classification, |
| 37 | AutocompleteMatch* match, |
mostynb | 01d8b10e | 2014-10-13 09:44:44 | [diff] [blame] | 38 | GURL* alternate_nav_url) override; |
Daniel Cheng | a542fca | 2014-10-21 09:51:29 | [diff] [blame] | 39 | void DeleteMatchingURLsForKeywordFromHistory( |
hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 40 | history::KeywordID keyword_id, |
mostynb | 01d8b10e | 2014-10-13 09:44:44 | [diff] [blame] | 41 | const base::string16& term) override; |
Daniel Cheng | a542fca | 2014-10-21 09:51:29 | [diff] [blame] | 42 | void PrefetchImage(const GURL& url) override; |
hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 43 | |
| 44 | private: |
| 45 | Profile* profile_; |
| 46 | ChromeAutocompleteSchemeClassifier scheme_classifier_; |
blundell | 0c5bb253 | 2015-06-16 14:23:14 | [diff] [blame^] | 47 | UIThreadSearchTermsData search_terms_data_; |
hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 48 | |
Ryo Hashimoto | 884ad19 | 2014-08-28 05:54:30 | [diff] [blame] | 49 | DISALLOW_COPY_AND_ASSIGN(ChromeAutocompleteProviderClient); |
hashimoto | 663b9f4 | 2014-08-26 04:29:20 | [diff] [blame] | 50 | }; |
| 51 | |
Ryo Hashimoto | 884ad19 | 2014-08-28 05:54:30 | [diff] [blame] | 52 | #endif // CHROME_BROWSER_AUTOCOMPLETE_CHROME_AUTOCOMPLETE_PROVIDER_CLIENT_H_ |