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_FEATURES_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_FEATURES_H_ |
6 #define COMPONENTS_NTP_SNIPPETS_FEATURES_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_FEATURES_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/feature_list.h" | 11 #include "base/feature_list.h" |
12 #include "components/ntp_snippets/category_rankers/category_ranker.h" | 12 #include "components/ntp_snippets/category_rankers/category_ranker.h" |
13 #include "components/prefs/pref_service.h" | 13 #include "components/prefs/pref_service.h" |
14 | 14 |
| 15 namespace base { |
| 16 class Clock; |
| 17 } |
| 18 |
15 namespace ntp_snippets { | 19 namespace ntp_snippets { |
16 | 20 |
17 // Features to turn individual providers/categories on/off. | 21 // Features to turn individual providers/categories on/off. |
18 extern const base::Feature kArticleSuggestionsFeature; | 22 extern const base::Feature kArticleSuggestionsFeature; |
19 extern const base::Feature kBookmarkSuggestionsFeature; | 23 extern const base::Feature kBookmarkSuggestionsFeature; |
20 extern const base::Feature kRecentOfflineTabSuggestionsFeature; | 24 extern const base::Feature kRecentOfflineTabSuggestionsFeature; |
21 extern const base::Feature kPhysicalWebPageSuggestionsFeature; | 25 extern const base::Feature kPhysicalWebPageSuggestionsFeature; |
22 extern const base::Feature kForeignSessionsSuggestionsFeature;; | 26 extern const base::Feature kForeignSessionsSuggestionsFeature;; |
23 | 27 |
24 // Feature to allow the 'save to offline' option to appear in the snippets | 28 // Feature to allow the 'save to offline' option to appear in the snippets |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 enum class CategoryRankerChoice { | 60 enum class CategoryRankerChoice { |
57 CONSTANT, | 61 CONSTANT, |
58 CLICK_BASED, | 62 CLICK_BASED, |
59 }; | 63 }; |
60 | 64 |
61 // Returns which CategoryRanker to use according to kCategoryRanker feature. | 65 // Returns which CategoryRanker to use according to kCategoryRanker feature. |
62 CategoryRankerChoice GetSelectedCategoryRanker(); | 66 CategoryRankerChoice GetSelectedCategoryRanker(); |
63 | 67 |
64 // Builds a CategoryRanker according to kCategoryRanker feature. | 68 // Builds a CategoryRanker according to kCategoryRanker feature. |
65 std::unique_ptr<CategoryRanker> BuildSelectedCategoryRanker( | 69 std::unique_ptr<CategoryRanker> BuildSelectedCategoryRanker( |
66 PrefService* pref_service); | 70 PrefService* pref_service, |
| 71 std::unique_ptr<base::Clock> clock); |
67 | 72 |
68 } // namespace ntp_snippets | 73 } // namespace ntp_snippets |
69 | 74 |
70 #endif // COMPONENTS_NTP_SNIPPETS_FEATURES_H_ | 75 #endif // COMPONENTS_NTP_SNIPPETS_FEATURES_H_ |
OLD | NEW |