blob: 901494bfa4eee3989f11fd2b5a0c7bf85224e49b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
// Copyright 2015 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 IOS_CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_PROVIDER_CLIENT_IMPL_H_
#define IOS_CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_PROVIDER_CLIENT_IMPL_H_
#include "base/macros.h"
#include "components/omnibox/browser/autocomplete_provider_client.h"
#include "ios/chrome/browser/autocomplete/autocomplete_scheme_classifier_impl.h"
#include "ios/chrome/browser/search_engines/ui_thread_search_terms_data.h"
namespace ios {
class ChromeBrowserState;
}
// AutocompleteProviderClientImpl provides iOS-specific implementation of
// AutocompleteProviderClient interface.
class AutocompleteProviderClientImpl : public AutocompleteProviderClient {
public:
explicit AutocompleteProviderClientImpl(
ios::ChromeBrowserState* browser_state);
~AutocompleteProviderClientImpl() override;
// AutocompleteProviderClient implementation.
net::URLRequestContextGetter* GetRequestContext() override;
PrefService* GetPrefs() override;
const AutocompleteSchemeClassifier& GetSchemeClassifier() const override;
AutocompleteClassifier* GetAutocompleteClassifier() override;
history::HistoryService* GetHistoryService() override;
scoped_refptr<history::TopSites> GetTopSites() override;
bookmarks::BookmarkModel* GetBookmarkModel() override;
history::URLDatabase* GetInMemoryDatabase() override;
InMemoryURLIndex* GetInMemoryURLIndex() override;
TemplateURLService* GetTemplateURLService() override;
const TemplateURLService* GetTemplateURLService() const override;
const SearchTermsData& GetSearchTermsData() const override;
scoped_refptr<ShortcutsBackend> GetShortcutsBackend() override;
scoped_refptr<ShortcutsBackend> GetShortcutsBackendIfExists() override;
scoped_ptr<KeywordExtensionsDelegate> GetKeywordExtensionsDelegate(
KeywordProvider* keyword_provider) override;
std::string GetAcceptLanguages() const override;
std::string GetEmbedderRepresentationOfAboutScheme() override;
std::vector<base::string16> GetBuiltinURLs() override;
std::vector<base::string16> GetBuiltinsToProvideAsUserTypes() override;
bool IsOffTheRecord() const override;
bool SearchSuggestEnabled() const override;
bool TabSyncEnabledAndUnencrypted() const override;
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) override;
void DeleteMatchingURLsForKeywordFromHistory(
history::KeywordID keyword_id,
const base::string16& term) override;
void PrefetchImage(const GURL& url) override;
void OnAutocompleteControllerResultReady(
AutocompleteController* controller) override;
private:
ios::ChromeBrowserState* browser_state_;
AutocompleteSchemeClassifierImpl scheme_classifier_;
ios::UIThreadSearchTermsData search_terms_data_;
DISALLOW_COPY_AND_ASSIGN(AutocompleteProviderClientImpl);
};
#endif // IOS_CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_PROVIDER_CLIENT_IMPL_H_
|