Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: components/omnibox/autocomplete_provider_client.h

Issue 1192373002: Prepare AutocompleteController for componentization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@componentize_zero_suggest_provider
Patch Set: Response to review Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/omnibox/BUILD.gn ('k') | components/omnibox/base_search_provider_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_CLIENT_H_ 5 #ifndef COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_CLIENT_H_
6 #define COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_CLIENT_H_ 6 #define COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_CLIENT_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "components/history/core/browser/keyword_id.h" 10 #include "components/history/core/browser/keyword_id.h"
11 #include "components/history/core/browser/top_sites.h" 11 #include "components/history/core/browser/top_sites.h"
12 #include "components/metrics/proto/omnibox_event.pb.h" 12 #include "components/metrics/proto/omnibox_event.pb.h"
13 #include "components/omnibox/keyword_extensions_delegate.h"
13 #include "components/omnibox/shortcuts_backend.h" 14 #include "components/omnibox/shortcuts_backend.h"
14 15
15 class AutocompleteController; 16 class AutocompleteController;
16 struct AutocompleteMatch; 17 struct AutocompleteMatch;
17 class AutocompleteClassifier; 18 class AutocompleteClassifier;
18 class AutocompleteSchemeClassifier; 19 class AutocompleteSchemeClassifier;
19 class GURL; 20 class GURL;
21 class InMemoryURLIndex;
22 class KeywordProvider;
20 class PrefService; 23 class PrefService;
21 class ShortcutsBackend; 24 class ShortcutsBackend;
22 25
23 namespace bookmarks { 26 namespace bookmarks {
24 class BookmarkModel; 27 class BookmarkModel;
25 } 28 }
26 29
27 namespace history { 30 namespace history {
28 class HistoryService; 31 class HistoryService;
29 class URLDatabase; 32 class URLDatabase;
(...skipping 11 matching lines...) Expand all
41 virtual ~AutocompleteProviderClient() {} 44 virtual ~AutocompleteProviderClient() {}
42 45
43 virtual net::URLRequestContextGetter* GetRequestContext() = 0; 46 virtual net::URLRequestContextGetter* GetRequestContext() = 0;
44 virtual PrefService* GetPrefs() = 0; 47 virtual PrefService* GetPrefs() = 0;
45 virtual const AutocompleteSchemeClassifier& GetSchemeClassifier() const = 0; 48 virtual const AutocompleteSchemeClassifier& GetSchemeClassifier() const = 0;
46 virtual AutocompleteClassifier* GetAutocompleteClassifier() = 0; 49 virtual AutocompleteClassifier* GetAutocompleteClassifier() = 0;
47 virtual history::HistoryService* GetHistoryService() = 0; 50 virtual history::HistoryService* GetHistoryService() = 0;
48 virtual scoped_refptr<history::TopSites> GetTopSites() = 0; 51 virtual scoped_refptr<history::TopSites> GetTopSites() = 0;
49 virtual bookmarks::BookmarkModel* GetBookmarkModel() = 0; 52 virtual bookmarks::BookmarkModel* GetBookmarkModel() = 0;
50 virtual history::URLDatabase* GetInMemoryDatabase() = 0; 53 virtual history::URLDatabase* GetInMemoryDatabase() = 0;
54 virtual InMemoryURLIndex* GetInMemoryURLIndex() = 0;
51 virtual TemplateURLService* GetTemplateURLService() = 0; 55 virtual TemplateURLService* GetTemplateURLService() = 0;
52 virtual const TemplateURLService* GetTemplateURLService() const = 0; 56 virtual const TemplateURLService* GetTemplateURLService() const = 0;
53 virtual const SearchTermsData& GetSearchTermsData() const = 0; 57 virtual const SearchTermsData& GetSearchTermsData() const = 0;
54 virtual scoped_refptr<ShortcutsBackend> GetShortcutsBackend() = 0; 58 virtual scoped_refptr<ShortcutsBackend> GetShortcutsBackend() = 0;
55 virtual scoped_refptr<ShortcutsBackend> GetShortcutsBackendIfExists() = 0; 59 virtual scoped_refptr<ShortcutsBackend> GetShortcutsBackendIfExists() = 0;
60 virtual scoped_ptr<KeywordExtensionsDelegate> GetKeywordExtensionsDelegate(
61 KeywordProvider* keyword_provider) = 0;
56 62
57 // The value to use for Accept-Languages HTTP header when making an HTTP 63 // The value to use for Accept-Languages HTTP header when making an HTTP
58 // request. 64 // request.
59 virtual std::string GetAcceptLanguages() const = 0; 65 virtual std::string GetAcceptLanguages() const = 0;
60 66
61 virtual bool IsOffTheRecord() const = 0; 67 virtual bool IsOffTheRecord() const = 0;
62 virtual bool SearchSuggestEnabled() const = 0; 68 virtual bool SearchSuggestEnabled() const = 0;
63 69
64 // Returns whether the bookmark bar is visible on all tabs. 70 // Returns whether the bookmark bar is visible on all tabs.
65 virtual bool BookmarkBarIsVisible() const = 0; 71 virtual bool BookmarkBarIsVisible() const = 0;
(...skipping 20 matching lines...) Expand all
86 92
87 // Called by |controller| when its results have changed and all providers are 93 // Called by |controller| when its results have changed and all providers are
88 // done processing the autocomplete request. At the //chrome level, this 94 // done processing the autocomplete request. At the //chrome level, this
89 // callback results in firing the 95 // callback results in firing the
90 // NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY notification. 96 // NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY notification.
91 // TODO(blundell): Remove the //chrome-level notification entirely in favor of 97 // TODO(blundell): Remove the //chrome-level notification entirely in favor of
92 // having AutocompleteController expose a CallbackList that //chrome-level 98 // having AutocompleteController expose a CallbackList that //chrome-level
93 // listeners add themselves to, and then kill this method. 99 // listeners add themselves to, and then kill this method.
94 virtual void OnAutocompleteControllerResultReady( 100 virtual void OnAutocompleteControllerResultReady(
95 AutocompleteController* controller) {} 101 AutocompleteController* controller) {}
102
103 // Called after creation of |keyword_provider| to allow the client to
104 // configure the provider if desired.
105 virtual void ConfigureKeywordProvider(KeywordProvider* keyword_provider) {}
96 }; 106 };
97 107
98 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_CLIENT_H_ 108 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_CLIENT_H_
OLDNEW
« no previous file with comments | « components/omnibox/BUILD.gn ('k') | components/omnibox/base_search_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698