| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_CHROME_AUTOCOMPLETE_PROVIDER_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_CHROME_AUTOCOMPLETE_PROVIDER_CLIENT_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_CHROME_AUTOCOMPLETE_PROVIDER_CLIENT_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_CHROME_AUTOCOMPLETE_PROVIDER_CLIENT_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" | 8 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" |
| 9 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" | 9 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" |
| 10 #include "components/omnibox/autocomplete_provider_client.h" | 10 #include "components/omnibox/autocomplete_provider_client.h" |
| 11 | 11 |
| 12 class Profile; | 12 class Profile; |
| 13 | 13 |
| 14 class ChromeAutocompleteProviderClient : public AutocompleteProviderClient { | 14 class ChromeAutocompleteProviderClient : public AutocompleteProviderClient { |
| 15 public: | 15 public: |
| 16 explicit ChromeAutocompleteProviderClient(Profile* profile); | 16 explicit ChromeAutocompleteProviderClient(Profile* profile); |
| 17 ~ChromeAutocompleteProviderClient() override; | 17 ~ChromeAutocompleteProviderClient() override; |
| 18 | 18 |
| 19 // AutocompleteProviderClient: | 19 // AutocompleteProviderClient: |
| 20 net::URLRequestContextGetter* GetRequestContext() override; | 20 net::URLRequestContextGetter* GetRequestContext() override; |
| 21 PrefService* GetPrefs() override; | 21 PrefService* GetPrefs() override; |
| 22 const AutocompleteSchemeClassifier& GetSchemeClassifier() const override; | 22 const AutocompleteSchemeClassifier& GetSchemeClassifier() const override; |
| 23 AutocompleteClassifier* GetAutocompleteClassifier() override; | 23 AutocompleteClassifier* GetAutocompleteClassifier() override; |
| 24 history::HistoryService* GetHistoryService() override; | 24 history::HistoryService* GetHistoryService() override; |
| 25 scoped_refptr<history::TopSites> GetTopSites() override; | 25 scoped_refptr<history::TopSites> GetTopSites() override; |
| 26 bookmarks::BookmarkModel* GetBookmarkModel() override; | 26 bookmarks::BookmarkModel* GetBookmarkModel() override; |
| 27 history::URLDatabase* GetInMemoryDatabase() override; | 27 history::URLDatabase* GetInMemoryDatabase() override; |
| 28 InMemoryURLIndex* GetInMemoryURLIndex() override; |
| 28 TemplateURLService* GetTemplateURLService() override; | 29 TemplateURLService* GetTemplateURLService() override; |
| 29 const SearchTermsData& GetSearchTermsData() override; | 30 const SearchTermsData& GetSearchTermsData() override; |
| 30 scoped_refptr<ShortcutsBackend> GetShortcutsBackend() override; | 31 scoped_refptr<ShortcutsBackend> GetShortcutsBackend() override; |
| 31 scoped_refptr<ShortcutsBackend> GetShortcutsBackendIfExists() override; | 32 scoped_refptr<ShortcutsBackend> GetShortcutsBackendIfExists() override; |
| 32 std::string GetAcceptLanguages() override; | 33 std::string GetAcceptLanguages() override; |
| 33 bool IsOffTheRecord() const override; | 34 bool IsOffTheRecord() const override; |
| 34 bool SearchSuggestEnabled() const override; | 35 bool SearchSuggestEnabled() const override; |
| 35 bool ShowBookmarkBar() override; | 36 bool ShowBookmarkBar() override; |
| 36 bool TabSyncEnabledAndUnencrypted() override; | 37 bool TabSyncEnabledAndUnencrypted() override; |
| 37 void Classify( | 38 void Classify( |
| 38 const base::string16& text, | 39 const base::string16& text, |
| 39 bool prefer_keyword, | 40 bool prefer_keyword, |
| 40 bool allow_exact_keyword_match, | 41 bool allow_exact_keyword_match, |
| 41 metrics::OmniboxEventProto::PageClassification page_classification, | 42 metrics::OmniboxEventProto::PageClassification page_classification, |
| 42 AutocompleteMatch* match, | 43 AutocompleteMatch* match, |
| 43 GURL* alternate_nav_url) override; | 44 GURL* alternate_nav_url) override; |
| 44 void DeleteMatchingURLsForKeywordFromHistory( | 45 void DeleteMatchingURLsForKeywordFromHistory( |
| 45 history::KeywordID keyword_id, | 46 history::KeywordID keyword_id, |
| 46 const base::string16& term) override; | 47 const base::string16& term) override; |
| 47 void PrefetchImage(const GURL& url) override; | 48 void PrefetchImage(const GURL& url) override; |
| 48 void OnAutocompleteControllerResultReady( | 49 void OnAutocompleteControllerResultReady( |
| 49 AutocompleteController* controller) override; | 50 AutocompleteController* controller) override; |
| 51 void ConfigureKeywordProvider(KeywordProvider* keyword_provider) override; |
| 50 | 52 |
| 51 private: | 53 private: |
| 52 Profile* profile_; | 54 Profile* profile_; |
| 53 ChromeAutocompleteSchemeClassifier scheme_classifier_; | 55 ChromeAutocompleteSchemeClassifier scheme_classifier_; |
| 54 UIThreadSearchTermsData search_terms_data_; | 56 UIThreadSearchTermsData search_terms_data_; |
| 55 | 57 |
| 56 DISALLOW_COPY_AND_ASSIGN(ChromeAutocompleteProviderClient); | 58 DISALLOW_COPY_AND_ASSIGN(ChromeAutocompleteProviderClient); |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 #endif // CHROME_BROWSER_AUTOCOMPLETE_CHROME_AUTOCOMPLETE_PROVIDER_CLIENT_H_ | 61 #endif // CHROME_BROWSER_AUTOCOMPLETE_CHROME_AUTOCOMPLETE_PROVIDER_CLIENT_H_ |
| OLD | NEW |