OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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 #include <memory> | |
6 | |
7 #include "base/files/scoped_temp_dir.h" | |
8 #include "base/test/sequenced_worker_pool_owner.h" | |
9 #include "components/omnibox/browser/mock_autocomplete_provider_client.h" | |
10 #include "components/omnibox/browser/test_scheme_classifier.h" | |
11 | |
12 namespace bookmarks { | |
13 class BookmarkModel; | |
14 } // namespace bookmarks | |
15 | |
16 namespace history { | |
17 class HistoryService; | |
18 } // namespace history | |
19 | |
20 class InMemoryURLIndex; | |
21 | |
22 // Fully operational AutocompleteProviderClient for usage in tests. | |
23 class FakeAutocompleteProviderClient : public MockAutocompleteProviderClient { | |
24 public: | |
25 FakeAutocompleteProviderClient(); | |
26 ~FakeAutocompleteProviderClient() override; | |
27 | |
28 const AutocompleteSchemeClassifier& GetSchemeClassifier() const override; | |
29 | |
Peter Kasting
2016/10/24 22:28:28
Nit: No blank lines between the overrides in this
dyaroshev
2016/10/25 18:11:34
Done
| |
30 const SearchTermsData& GetSearchTermsData() const override; | |
31 | |
32 history::HistoryService* GetHistoryService() override; | |
33 | |
34 bookmarks::BookmarkModel* GetBookmarkModel() override; | |
35 | |
36 InMemoryURLIndex* GetInMemoryURLIndex() override; | |
37 | |
38 void set_in_memory_url_index(std::unique_ptr<InMemoryURLIndex> index) { | |
39 in_memory_url_index_ = std::move(index); | |
40 } | |
41 | |
42 private: | |
43 base::SequencedWorkerPoolOwner pool_owner_; | |
44 base::ScopedTempDir history_dir_; | |
45 std::unique_ptr<bookmarks::BookmarkModel> bookmark_model_; | |
46 TestSchemeClassifier scheme_classifier_; | |
47 SearchTermsData search_terms_data_; | |
48 std::unique_ptr<InMemoryURLIndex> in_memory_url_index_; | |
49 std::unique_ptr<history::HistoryService> history_service_; | |
50 | |
51 DISALLOW_COPY_AND_ASSIGN(FakeAutocompleteProviderClient); | |
52 }; | |
OLD | NEW |