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_PREF_NAMES_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_PREF_NAMES_H_ |
6 #define COMPONENTS_NTP_SNIPPETS_PREF_NAMES_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_PREF_NAMES_H_ |
7 | 7 |
8 #include <set> | |
9 #include <string> | |
10 | |
11 class PrefService; | |
12 | |
8 namespace ntp_snippets { | 13 namespace ntp_snippets { |
9 namespace prefs { | 14 namespace prefs { |
10 | 15 |
11 extern const char kEnableSnippets[]; | 16 extern const char kEnableSnippets[]; |
12 | 17 |
13 extern const char kSnippetHosts[]; | 18 extern const char kSnippetHosts[]; |
14 | 19 |
15 // The pref name for today's count of NTPSnippetsFetcher requests, so far. | 20 // The pref name for today's count of NTPSnippetsFetcher requests, so far. |
16 extern const char kSnippetFetcherRequestCount[]; | 21 extern const char kSnippetFetcherRequestCount[]; |
17 // The pref name for today's count of NTPSnippetsFetcher interactive requests. | 22 // The pref name for today's count of NTPSnippetsFetcher interactive requests. |
18 extern const char kSnippetFetcherInteractiveRequestCount[]; | 23 extern const char kSnippetFetcherInteractiveRequestCount[]; |
19 // The pref name for the current day for the counter of NTPSnippetsFetcher | 24 // The pref name for the current day for the counter of NTPSnippetsFetcher |
20 // requests. | 25 // requests. |
21 extern const char kSnippetFetcherRequestsDay[]; | 26 extern const char kSnippetFetcherRequestsDay[]; |
22 | 27 |
23 // The pref name for today's count of requests for article thumbnails, so far. | 28 // The pref name for today's count of requests for article thumbnails, so far. |
24 extern const char kSnippetThumbnailsRequestCount[]; | 29 extern const char kSnippetThumbnailsRequestCount[]; |
25 // The pref name for today's count of interactive requests for article | 30 // The pref name for today's count of interactive requests for article |
26 // thumbnails, so far. | 31 // thumbnails, so far. |
27 extern const char kSnippetThumbnailsInteractiveRequestCount[]; | 32 extern const char kSnippetThumbnailsInteractiveRequestCount[]; |
28 // The pref name for the current day for the counter of requests for article | 33 // The pref name for the current day for the counter of requests for article |
29 // thumbnails. | 34 // thumbnails. |
30 extern const char kSnippetThumbnailsRequestsDay[]; | 35 extern const char kSnippetThumbnailsRequestsDay[]; |
31 | 36 |
32 extern const char kDismissedRecentOfflineTabSuggestions[]; | 37 extern const char kDismissedRecentOfflineTabSuggestions[]; |
33 extern const char kDismissedDownloadSuggestions[]; | 38 extern const char kDismissedDownloadSuggestions[]; |
39 extern const char kDismissedForeignSessionsSuggestions[]; | |
34 | 40 |
35 // The pref name for the time when M54 was first started on the device. | 41 // The pref name for the time when M54 was first started on the device. |
36 extern const char kBookmarksFirstM54Start[]; | 42 extern const char kBookmarksFirstM54Start[]; |
37 | 43 |
44 std::set<std::string> ReadDismissedIDsFromPrefs(const std::string& pref_name, | |
45 PrefService* pref_service); | |
Marc Treib
2016/08/29 09:18:50
nit: const
nit²: Should |pref_service| be the firs
tschumann
2016/08/29 09:39:15
yeah, let's make |pref_service| a const reference
battre
2016/08/29 09:48:26
Do these functions belong into pref_names.h?
skym
2016/09/15 23:18:17
Done. Done.
skym
2016/09/15 23:18:17
Moved to their own file.
skym
2016/09/15 23:18:17
Done.
| |
46 | |
47 void StoreDismissedIDsToPrefs(const std::string& pref_name, | |
48 const std::set<std::string>& dismissed_ids, | |
49 PrefService* pref_service); | |
50 | |
38 } // namespace prefs | 51 } // namespace prefs |
39 } // namespace ntp_snippets | 52 } // namespace ntp_snippets |
40 | 53 |
41 #endif // COMPONENTS_NTP_SNIPPETS_PREF_NAMES_H_ | 54 #endif // COMPONENTS_NTP_SNIPPETS_PREF_NAMES_H_ |
OLD | NEW |