OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_SUGGESTIONS_PROVIDER_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_SUGGESTIONS_PROVIDER_H_ |
6 #define COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_SUGGESTIONS_PROVIDER_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_SUGGESTIONS_PROVIDER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "components/bookmarks/browser/bookmark_model_observer.h" | 12 #include "components/bookmarks/browser/bookmark_model_observer.h" |
13 #include "components/keyed_service/core/keyed_service.h" | 13 #include "components/keyed_service/core/keyed_service.h" |
14 #include "components/ntp_snippets/category.h" | 14 #include "components/ntp_snippets/category.h" |
15 #include "components/ntp_snippets/category_status.h" | 15 #include "components/ntp_snippets/category_status.h" |
16 #include "components/ntp_snippets/content_suggestions_provider.h" | 16 #include "components/ntp_snippets/content_suggestions_provider.h" |
17 | 17 |
18 class PrefRegistrySimple; | 18 class PrefRegistrySimple; |
19 class PrefService; | 19 class PrefService; |
20 | 20 |
21 namespace ntp_snippets { | 21 namespace ntp_snippets { |
22 | 22 |
23 // Provides content suggestions from the bookmarks model. | 23 // Provides content suggestions from the bookmarks model. |
24 class BookmarkSuggestionsProvider : public ContentSuggestionsProvider, | 24 class BookmarkSuggestionsProvider : public ContentSuggestionsProvider, |
25 public bookmarks::BookmarkModelObserver { | 25 public bookmarks::BookmarkModelObserver { |
26 public: | 26 public: |
27 BookmarkSuggestionsProvider(ContentSuggestionsProvider::Observer* observer, | 27 BookmarkSuggestionsProvider(ContentSuggestionsProvider::Observer* observer, |
28 CategoryFactory* category_factory, | |
29 bookmarks::BookmarkModel* bookmark_model, | 28 bookmarks::BookmarkModel* bookmark_model, |
30 PrefService* pref_service); | 29 PrefService* pref_service); |
31 ~BookmarkSuggestionsProvider() override; | 30 ~BookmarkSuggestionsProvider() override; |
32 | 31 |
33 static void RegisterProfilePrefs(PrefRegistrySimple* registry); | 32 static void RegisterProfilePrefs(PrefRegistrySimple* registry); |
34 | 33 |
35 private: | 34 private: |
36 // ContentSuggestionsProvider implementation. | 35 // ContentSuggestionsProvider implementation. |
37 CategoryStatus GetCategoryStatus(Category category) override; | 36 CategoryStatus GetCategoryStatus(Category category) override; |
38 CategoryInfo GetCategoryInfo(Category category) override; | 37 CategoryInfo GetCategoryInfo(Category category) override; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // deciding which bookmarks to suggest. Should we also consider visits on | 113 // deciding which bookmarks to suggest. Should we also consider visits on |
115 // desktop platforms? | 114 // desktop platforms? |
116 bool consider_bookmark_visits_from_desktop_; | 115 bool consider_bookmark_visits_from_desktop_; |
117 | 116 |
118 DISALLOW_COPY_AND_ASSIGN(BookmarkSuggestionsProvider); | 117 DISALLOW_COPY_AND_ASSIGN(BookmarkSuggestionsProvider); |
119 }; | 118 }; |
120 | 119 |
121 } // namespace ntp_snippets | 120 } // namespace ntp_snippets |
122 | 121 |
123 #endif // COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_SUGGESTIONS_PROVIDER_H_ | 122 #endif // COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_SUGGESTIONS_PROVIDER_H_ |
OLD | NEW |