Fix experimental app list search box disappearing on profile switch.
[chromium-blink-merge.git] / components / omnibox / autocomplete_provider_client.h
blob0cbdc07688f1192e44e9b2dea53551d2d98e8de8
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.
5 #ifndef COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_CLIENT_H_
6 #define COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_CLIENT_H_
8 #include "base/strings/string16.h"
9 #include "components/history/core/browser/keyword_id.h"
10 #include "components/metrics/proto/omnibox_event.pb.h"
12 struct AutocompleteMatch;
13 class AutocompleteSchemeClassifier;
14 class GURL;
16 namespace history {
17 class URLDatabase;
20 namespace net {
21 class URLRequestContextGetter;
24 class AutocompleteProviderClient {
25 public:
26 virtual ~AutocompleteProviderClient() {}
28 // Returns the request context.
29 virtual net::URLRequestContextGetter* RequestContext() = 0;
31 // Returns whether the provider should work in incognito mode.
32 virtual bool IsOffTheRecord() = 0;
34 // The value to use for Accept-Languages HTTP header when making an HTTP
35 // request.
36 virtual std::string AcceptLanguages() = 0;
38 // Returns true when suggest support is enabled.
39 virtual bool SearchSuggestEnabled() = 0;
41 // Returns whether the bookmark bar is visible on all tabs.
42 virtual bool ShowBookmarkBar() = 0;
44 // Returns the scheme classifier.
45 virtual const AutocompleteSchemeClassifier& SchemeClassifier() = 0;
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;
57 // Returns the in-memory URL database.
58 virtual history::URLDatabase* InMemoryDatabase() = 0;
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;
66 // Returns whether the user has tab sync enabled and tab sync is unencrypted.
67 virtual bool TabSyncEnabledAndUnencrypted() = 0;
69 // Starts prefetching the image at the given |url|.
70 virtual void PrefetchImage(const GURL& url) = 0;
73 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_CLIENT_H_