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