Chromium Code Reviews| 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 #include "components/ntp_snippets/features.h" | 5 #include "components/ntp_snippets/features.h" |
| 6 | 6 |
| 7 #include "base/feature_list.h" | 7 #include "base/feature_list.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/time/clock.h" | 9 #include "base/time/clock.h" |
| 10 #include "components/ntp_snippets/category_rankers/click_based_category_ranker.h " | 10 #include "components/ntp_snippets/category_rankers/click_based_category_ranker.h " |
| 11 #include "components/ntp_snippets/category_rankers/constant_category_ranker.h" | 11 #include "components/ntp_snippets/category_rankers/constant_category_ranker.h" |
| 12 #include "components/variations/variations_associated_data.h" | 12 #include "components/variations/variations_associated_data.h" |
| 13 | 13 |
| 14 namespace ntp_snippets { | 14 namespace ntp_snippets { |
| 15 | 15 |
| 16 // Keep sorted, and keep nullptr at the end. | |
| 17 const base::Feature*(kAllFeatures[]) = {&kArticleSuggestionsFeature, | |
|
jkrcal
2017/04/19 11:23:40
I am a bit worried this can easily get out of sync
sfiera
2017/04/19 11:41:10
Ack :|
| |
| 18 &kBookmarkSuggestionsFeature, | |
| 19 &kCategoryOrder, | |
| 20 &kCategoryRanker, | |
| 21 &kForeignSessionsSuggestionsFeature, | |
| 22 &kIncreasedVisibility, | |
| 23 &kNotificationsFeature, | |
| 24 &kPhysicalWebPageSuggestionsFeature, | |
| 25 &kPreferAmpUrlsFeature, | |
| 26 &kPublisherFaviconsFromNewServerFeature, | |
| 27 &kRecentOfflineTabSuggestionsFeature, | |
| 28 nullptr}; | |
| 29 | |
| 16 const base::Feature kArticleSuggestionsFeature{ | 30 const base::Feature kArticleSuggestionsFeature{ |
| 17 "NTPArticleSuggestions", base::FEATURE_ENABLED_BY_DEFAULT}; | 31 "NTPArticleSuggestions", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 18 | 32 |
| 19 const base::Feature kBookmarkSuggestionsFeature{ | 33 const base::Feature kBookmarkSuggestionsFeature{ |
| 20 "NTPBookmarkSuggestions", base::FEATURE_ENABLED_BY_DEFAULT}; | 34 "NTPBookmarkSuggestions", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 21 | 35 |
| 22 const base::Feature kRecentOfflineTabSuggestionsFeature{ | 36 const base::Feature kRecentOfflineTabSuggestionsFeature{ |
| 23 "NTPOfflinePageSuggestions", base::FEATURE_DISABLED_BY_DEFAULT}; | 37 "NTPOfflinePageSuggestions", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 24 | 38 |
| 25 const base::Feature kIncreasedVisibility{"NTPSnippetsIncreasedVisibility", | 39 const base::Feature kIncreasedVisibility{"NTPSnippetsIncreasedVisibility", |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 } | 120 } |
| 107 if (category_order_value == kCategoryOrderEmergingMarketsOriented) { | 121 if (category_order_value == kCategoryOrderEmergingMarketsOriented) { |
| 108 return CategoryOrderChoice::EMERGING_MARKETS_ORIENTED; | 122 return CategoryOrderChoice::EMERGING_MARKETS_ORIENTED; |
| 109 } | 123 } |
| 110 | 124 |
| 111 LOG(DFATAL) << "The " << kCategoryOrderParameter << " parameter value is '" | 125 LOG(DFATAL) << "The " << kCategoryOrderParameter << " parameter value is '" |
| 112 << category_order_value << "'"; | 126 << category_order_value << "'"; |
| 113 return CategoryOrderChoice::GENERAL; | 127 return CategoryOrderChoice::GENERAL; |
| 114 } | 128 } |
| 115 | 129 |
| 130 const base::Feature kNotificationsFeature = {"ContentSuggestionsNotifications", | |
| 131 base::FEATURE_DISABLED_BY_DEFAULT}; | |
| 132 | |
| 133 const char kNotificationsPriorityParam[] = "priority"; | |
| 134 const char kNotificationsTextParam[] = "text"; | |
| 135 const char kNotificationsTextValuePublisher[] = "publisher"; | |
| 136 const char kNotificationsTextValueSnippet[] = "snippet"; | |
| 137 const char kNotificationsTextValueAndMore[] = "and_more"; | |
| 138 const char kNotificationsKeepWhenFrontmostParam[] = | |
| 139 "keep_notification_when_frontmost"; | |
| 140 const char kNotificationsOpenToNTPParam[] = "open_to_ntp"; | |
| 141 const char kNotificationsDailyLimit[] = "daily_limit"; | |
| 142 const char kNotificationsIgnoredLimitParam[] = "ignored_limit"; | |
| 143 | |
| 116 } // namespace ntp_snippets | 144 } // namespace ntp_snippets |
| OLD | NEW |