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

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

Issue 500023002: Introduce AutocompleteProviderDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
(Empty)
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
5 #ifndef COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_DELEGATE_H_
6 #define COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_DELEGATE_H_
7
8 #include "base/strings/string16.h"
9 #include "components/history/core/browser/keyword_id.h"
10 #include "components/metrics/proto/omnibox_event.pb.h"
11
12 struct AutocompleteMatch;
13 class AutocompleteSchemeClassifier;
14 class GURL;
15
16 namespace history {
17 class URLDatabase;
18 }
19
20 namespace net {
21 class URLRequestContextGetter;
22 }
23
24 class AutocompleteProviderDelegate {
25 public:
26 virtual ~AutocompleteProviderDelegate() {}
27
28 // Returns the request context.
29 virtual net::URLRequestContextGetter* GetRequestContext() = 0;
Peter Kasting 2014/08/25 19:11:00 Nit: Some of your APIs are called "GetX()" (like t
hashimoto 2014/08/26 00:52:30 Removed "Get"s.
30
31 // Returns whether the provider should work in incognito mode.
32 virtual bool IsOffTheRecord() = 0;
33
34 // The value to use for Accept-Languages HTTP header when making an HTTP
35 // request.
36 virtual std::string GetAcceptLanguages() = 0;
37
38 // Returns true when suggest support is enabled.
39 virtual bool SearchSuggestEnabled() = 0;
40
41 // Returns whether the bookmark bar is visible on all tabs.
42 virtual bool ShowBookmarkBar() = 0;
43
44 // Returns the scheme classifier.
45 virtual const AutocompleteSchemeClassifier& GetSchemeClassifier() = 0;
46
47 // Given some string |text| that the user wants to use for navigation,
48 // determines how it should be interpreted.
49 virtual void Classify(
50 const base::string16& text,
51 bool prefer_keyword,
52 bool allow_exact_keyword_match,
53 metrics::OmniboxEventProto::PageClassification page_classification,
54 AutocompleteMatch* match,
55 GURL* alternate_nav_url) = 0;
56
57 // Returns the in-memory URL database.
58 virtual history::URLDatabase* InMemoryDatabase() = 0;
59
60 // Deletes all URL and search term entries matching the given |term| and
61 // |keyword_id| from history.
62 virtual void DeleteMatchingURLsForKeywordFromHistory(
63 history::KeywordID keyword_id,
64 const base::string16& term) = 0;
65
66 // Returns whether the user has tab sync enabled and tab sync is unencrypted.
67 virtual bool TabSyncEnabledAndUnencrypted() = 0;
68
69 // Start prefetching the image at the given |url|.
Peter Kasting 2014/08/25 19:11:00 Nit: Starts
hashimoto 2014/08/26 00:52:30 Done.
70 virtual void PrefetchImage(const GURL& url) = 0;
71 };
72
73 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698