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 |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 // Feature to allow UI as specified here: https://crbug.com/660837. | 40 // Feature to allow UI as specified here: https://crbug.com/660837. |
41 extern const base::Feature kIncreasedVisibility; | 41 extern const base::Feature kIncreasedVisibility; |
42 | 42 |
43 // Feature to prefer AMP URLs over regular URLs when available. | 43 // Feature to prefer AMP URLs over regular URLs when available. |
44 extern const base::Feature kPreferAmpUrlsFeature; | 44 extern const base::Feature kPreferAmpUrlsFeature; |
45 | 45 |
46 // Feature to choose a category ranker. | 46 // Feature to choose a category ranker. |
47 extern const base::Feature kCategoryRanker; | 47 extern const base::Feature kCategoryRanker; |
48 | 48 |
49 // Parameter for a kCategoryRanker feature flag. | 49 // Parameter and its values for the kCategoryRanker feature flag. |
50 extern const char kCategoryRankerParameter[]; | 50 extern const char kCategoryRankerParameter[]; |
51 // Possible values of the parameter above. | |
52 extern const char kCategoryRankerConstantRanker[]; | 51 extern const char kCategoryRankerConstantRanker[]; |
53 extern const char kCategoryRankerClickBasedRanker[]; | 52 extern const char kCategoryRankerClickBasedRanker[]; |
54 | 53 |
55 enum class CategoryRankerChoice { | 54 enum class CategoryRankerChoice { |
56 CONSTANT, | 55 CONSTANT, |
57 CLICK_BASED, | 56 CLICK_BASED, |
58 }; | 57 }; |
59 | 58 |
60 // Returns which CategoryRanker to use according to kCategoryRanker feature. | 59 // Returns which CategoryRanker to use according to kCategoryRanker feature. |
61 CategoryRankerChoice GetSelectedCategoryRanker(); | 60 CategoryRankerChoice GetSelectedCategoryRanker(); |
62 | 61 |
63 // Builds a CategoryRanker according to kCategoryRanker feature. | 62 // Builds a CategoryRanker according to kCategoryRanker feature. |
64 std::unique_ptr<CategoryRanker> BuildSelectedCategoryRanker( | 63 std::unique_ptr<CategoryRanker> BuildSelectedCategoryRanker( |
65 PrefService* pref_service, | 64 PrefService* pref_service, |
66 std::unique_ptr<base::Clock> clock); | 65 std::unique_ptr<base::Clock> clock); |
67 | 66 |
| 67 // Feature to choose a default category order. |
| 68 extern const base::Feature kCategoryOrder; |
| 69 |
| 70 // Parameter and its values for the kCategoryOrder feature flag. |
| 71 extern const char kCategoryOrderParameter[]; |
| 72 extern const char kCategoryOrderGeneral[]; |
| 73 extern const char kCategoryOrderEmergingMarketsOriented[]; |
| 74 |
| 75 enum class CategoryOrderChoice { |
| 76 GENERAL, |
| 77 EMERGING_MARKETS_ORIENTED, |
| 78 }; |
| 79 |
| 80 // Returns which category order to use according to kCategoryOrder feature. |
| 81 CategoryOrderChoice GetSelectedCategoryOrder(); |
| 82 |
68 } // namespace ntp_snippets | 83 } // namespace ntp_snippets |
69 | 84 |
70 #endif // COMPONENTS_NTP_SNIPPETS_FEATURES_H_ | 85 #endif // COMPONENTS_NTP_SNIPPETS_FEATURES_H_ |
OLD | NEW |