Index: components/omnibox/autocomplete_provider_delegate.h |
diff --git a/components/omnibox/autocomplete_provider_delegate.h b/components/omnibox/autocomplete_provider_delegate.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8e1767e6c3a687ac52b320178759576fe5509a6f |
--- /dev/null |
+++ b/components/omnibox/autocomplete_provider_delegate.h |
@@ -0,0 +1,73 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_DELEGATE_H_ |
+#define COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_DELEGATE_H_ |
+ |
+#include "base/strings/string16.h" |
+#include "components/history/core/browser/keyword_id.h" |
+#include "components/metrics/proto/omnibox_event.pb.h" |
+ |
+struct AutocompleteMatch; |
+class AutocompleteSchemeClassifier; |
+class GURL; |
+ |
+namespace history { |
+class URLDatabase; |
+} |
+ |
+namespace net { |
+class URLRequestContextGetter; |
+} |
+ |
+class AutocompleteProviderDelegate { |
+ public: |
+ virtual ~AutocompleteProviderDelegate() {} |
+ |
+ // Returns the request context. |
+ 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.
|
+ |
+ // Returns whether the provider should work in incognito mode. |
+ virtual bool IsOffTheRecord() = 0; |
+ |
+ // The value to use for Accept-Languages HTTP header when making an HTTP |
+ // request. |
+ virtual std::string GetAcceptLanguages() = 0; |
+ |
+ // Returns true when suggest support is enabled. |
+ virtual bool SearchSuggestEnabled() = 0; |
+ |
+ // Returns whether the bookmark bar is visible on all tabs. |
+ virtual bool ShowBookmarkBar() = 0; |
+ |
+ // Returns the scheme classifier. |
+ virtual const AutocompleteSchemeClassifier& GetSchemeClassifier() = 0; |
+ |
+ // Given some string |text| that the user wants to use for navigation, |
+ // determines how it should be interpreted. |
+ virtual void Classify( |
+ const base::string16& text, |
+ bool prefer_keyword, |
+ bool allow_exact_keyword_match, |
+ metrics::OmniboxEventProto::PageClassification page_classification, |
+ AutocompleteMatch* match, |
+ GURL* alternate_nav_url) = 0; |
+ |
+ // Returns the in-memory URL database. |
+ virtual history::URLDatabase* InMemoryDatabase() = 0; |
+ |
+ // Deletes all URL and search term entries matching the given |term| and |
+ // |keyword_id| from history. |
+ virtual void DeleteMatchingURLsForKeywordFromHistory( |
+ history::KeywordID keyword_id, |
+ const base::string16& term) = 0; |
+ |
+ // Returns whether the user has tab sync enabled and tab sync is unencrypted. |
+ virtual bool TabSyncEnabledAndUnencrypted() = 0; |
+ |
+ // 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.
|
+ virtual void PrefetchImage(const GURL& url) = 0; |
+}; |
+ |
+#endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_DELEGATE_H_ |