Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: components/ntp_snippets/features.h

Issue 2831553003: List our features in ntp_snippets::kAllFeatures (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 { 15 namespace base {
16 class Clock; 16 class Clock;
17 } 17 }
18 18
19 namespace ntp_snippets { 19 namespace ntp_snippets {
20 20
21 // Null-terminated list of all features related to content suggestions.
22 extern const base::Feature*(kAllFeatures[]);
dgn 2017/04/19 12:53:26 nit: add a big comment here or at the beginning of
sfiera 2017/04/19 13:04:53 I lengthened it here, but I'm not sure it's flashy
23
21 // Features to turn individual providers/categories on/off. 24 // Features to turn individual providers/categories on/off.
22 // TODO(jkrcal): Rename to kRemoteSuggestionsFeature. 25 // TODO(jkrcal): Rename to kRemoteSuggestionsFeature.
23 extern const base::Feature kArticleSuggestionsFeature; 26 extern const base::Feature kArticleSuggestionsFeature;
24 extern const base::Feature kBookmarkSuggestionsFeature; 27 extern const base::Feature kBookmarkSuggestionsFeature;
25 extern const base::Feature kRecentOfflineTabSuggestionsFeature; 28 extern const base::Feature kRecentOfflineTabSuggestionsFeature;
26 extern const base::Feature kPhysicalWebPageSuggestionsFeature; 29 extern const base::Feature kPhysicalWebPageSuggestionsFeature;
27 extern const base::Feature kForeignSessionsSuggestionsFeature; 30 extern const base::Feature kForeignSessionsSuggestionsFeature;
28 31
29 // Feature to allow UI as specified here: https://crbug.com/660837. 32 // Feature to allow UI as specified here: https://crbug.com/660837.
30 extern const base::Feature kIncreasedVisibility; 33 extern const base::Feature kIncreasedVisibility;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 extern const char kCategoryOrderEmergingMarketsOriented[]; 68 extern const char kCategoryOrderEmergingMarketsOriented[];
66 69
67 enum class CategoryOrderChoice { 70 enum class CategoryOrderChoice {
68 GENERAL, 71 GENERAL,
69 EMERGING_MARKETS_ORIENTED, 72 EMERGING_MARKETS_ORIENTED,
70 }; 73 };
71 74
72 // Returns which category order to use according to kCategoryOrder feature. 75 // Returns which category order to use according to kCategoryOrder feature.
73 CategoryOrderChoice GetSelectedCategoryOrder(); 76 CategoryOrderChoice GetSelectedCategoryOrder();
74 77
78 // Enables and configures notifications for content suggestions on Android.
79 extern const base::Feature kNotificationsFeature;
80
81 // An integer. The priority of the notification, ranging from -2 (PRIORITY_MIN)
82 // to 2 (PRIORITY_MAX). Vibrates and makes sound if >= 0.
83 extern const char kNotificationsPriorityParam[];
84 constexpr int kNotificationsDefaultPriority = -1;
85
86 // "publisher": use article's publisher as notification's text (default).
87 // "snippet": use article's snippet as notification's text.
88 // "and_more": use "From $1. Read this article and $2 more." as text.
89 extern const char kNotificationsTextParam[];
90 extern const char kNotificationsTextValuePublisher[];
91 extern const char kNotificationsTextValueSnippet[];
92 extern const char kNotificationsTextValueAndMore[];
93
94 // "true": when Chrome becomes frontmost, leave notifications open.
95 // "false": automatically dismiss notification when Chrome becomes frontmost.
96 extern const char kNotificationsKeepWhenFrontmostParam[];
97
98 // "true": notifications link to chrome://newtab, with appropriate text.
99 // "false": notifications link to URL of notifying article.
100 extern const char kNotificationsOpenToNTPParam[];
101
102 // An integer. The maximum number of notifications that will be shown in 1 day.
103 extern const char kNotificationsDailyLimit[];
104 constexpr int kNotificationsDefaultDailyLimit = 1;
105
106 // An integer. The number of notifications that can be ignored. If the user
107 // ignores this many notifications or more, we stop sending them.
108 extern const char kNotificationsIgnoredLimitParam[];
109 constexpr int kNotificationsIgnoredDefaultLimit = 3;
110
75 } // namespace ntp_snippets 111 } // namespace ntp_snippets
76 112
77 #endif // COMPONENTS_NTP_SNIPPETS_FEATURES_H_ 113 #endif // COMPONENTS_NTP_SNIPPETS_FEATURES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698