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

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: Remove stale include 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
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/shortcuts_backend.h" 13 #include "components/omnibox/shortcuts_backend.h"
14 14
15 class AutocompleteController; 15 class AutocompleteController;
16 struct AutocompleteMatch; 16 struct AutocompleteMatch;
17 class AutocompleteClassifier; 17 class AutocompleteClassifier;
18 class AutocompleteSchemeClassifier; 18 class AutocompleteSchemeClassifier;
19 class GURL; 19 class GURL;
20 class InMemoryURLIndex;
21 class KeywordProvider;
20 class PrefService; 22 class PrefService;
21 class ShortcutsBackend; 23 class ShortcutsBackend;
22 24
23 namespace bookmarks { 25 namespace bookmarks {
24 class BookmarkModel; 26 class BookmarkModel;
25 } 27 }
26 28
27 namespace history { 29 namespace history {
28 class HistoryService; 30 class HistoryService;
29 class URLDatabase; 31 class URLDatabase;
(...skipping 11 matching lines...) Expand all
41 virtual ~AutocompleteProviderClient() {} 43 virtual ~AutocompleteProviderClient() {}
42 44
43 virtual net::URLRequestContextGetter* GetRequestContext() = 0; 45 virtual net::URLRequestContextGetter* GetRequestContext() = 0;
44 virtual PrefService* GetPrefs() = 0; 46 virtual PrefService* GetPrefs() = 0;
45 virtual const AutocompleteSchemeClassifier& GetSchemeClassifier() const = 0; 47 virtual const AutocompleteSchemeClassifier& GetSchemeClassifier() const = 0;
46 virtual AutocompleteClassifier* GetAutocompleteClassifier() = 0; 48 virtual AutocompleteClassifier* GetAutocompleteClassifier() = 0;
47 virtual history::HistoryService* GetHistoryService() = 0; 49 virtual history::HistoryService* GetHistoryService() = 0;
48 virtual scoped_refptr<history::TopSites> GetTopSites() = 0; 50 virtual scoped_refptr<history::TopSites> GetTopSites() = 0;
49 virtual bookmarks::BookmarkModel* GetBookmarkModel() = 0; 51 virtual bookmarks::BookmarkModel* GetBookmarkModel() = 0;
50 virtual history::URLDatabase* GetInMemoryDatabase() = 0; 52 virtual history::URLDatabase* GetInMemoryDatabase() = 0;
53 virtual InMemoryURLIndex* GetInMemoryURLIndex() = 0;
51 virtual TemplateURLService* GetTemplateURLService() = 0; 54 virtual TemplateURLService* GetTemplateURLService() = 0;
52 virtual const SearchTermsData& GetSearchTermsData() = 0; 55 virtual const SearchTermsData& GetSearchTermsData() = 0;
53 virtual scoped_refptr<ShortcutsBackend> GetShortcutsBackend() = 0; 56 virtual scoped_refptr<ShortcutsBackend> GetShortcutsBackend() = 0;
54 virtual scoped_refptr<ShortcutsBackend> GetShortcutsBackendIfExists() = 0; 57 virtual scoped_refptr<ShortcutsBackend> GetShortcutsBackendIfExists() = 0;
55 58
56 // The value to use for Accept-Languages HTTP header when making an HTTP 59 // The value to use for Accept-Languages HTTP header when making an HTTP
57 // request. 60 // request.
58 virtual std::string GetAcceptLanguages() = 0; 61 virtual std::string GetAcceptLanguages() = 0;
59 62
60 virtual bool IsOffTheRecord() const = 0; 63 virtual bool IsOffTheRecord() const = 0;
(...skipping 24 matching lines...) Expand all
85 88
86 // Called by |controller| when its results have changed and all providers are 89 // Called by |controller| when its results have changed and all providers are
87 // done processing the autocomplete request. At the //chrome level, this 90 // done processing the autocomplete request. At the //chrome level, this
88 // callback results in firing the 91 // callback results in firing the
89 // NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY notification. 92 // NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY notification.
90 // TODO(blundell): Remove the //chrome-level notification entirely in favor of 93 // TODO(blundell): Remove the //chrome-level notification entirely in favor of
91 // having AutocompleteController expose a CallbackList that //chrome-level 94 // having AutocompleteController expose a CallbackList that //chrome-level
92 // listeners add themselves to, and then kill this method. 95 // listeners add themselves to, and then kill this method.
93 virtual void OnAutocompleteControllerResultReady( 96 virtual void OnAutocompleteControllerResultReady(
94 AutocompleteController* controller) {} 97 AutocompleteController* controller) {}
98
99 // Called after creation of |keyword_provider| to allow the client to
100 // configure the provider if desired.
101 virtual void ConfigureKeywordProvider(KeywordProvider* keyword_provider) {}
95 }; 102 };
96 103
97 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_CLIENT_H_ 104 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698