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 const SearchTermsData& GetSearchTermsData() const override; |
| 30 history::HistoryService* GetHistoryService() override; |
| 31 bookmarks::BookmarkModel* GetBookmarkModel() override; |
| 32 InMemoryURLIndex* GetInMemoryURLIndex() override; |
| 33 |
| 34 void set_in_memory_url_index(std::unique_ptr<InMemoryURLIndex> index) { |
| 35 in_memory_url_index_ = std::move(index); |
| 36 } |
| 37 |
| 38 private: |
| 39 base::SequencedWorkerPoolOwner pool_owner_; |
| 40 base::ScopedTempDir history_dir_; |
| 41 std::unique_ptr<bookmarks::BookmarkModel> bookmark_model_; |
| 42 TestSchemeClassifier scheme_classifier_; |
| 43 SearchTermsData search_terms_data_; |
| 44 std::unique_ptr<InMemoryURLIndex> in_memory_url_index_; |
| 45 std::unique_ptr<history::HistoryService> history_service_; |
| 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(FakeAutocompleteProviderClient); |
| 48 }; |
OLD | NEW |