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_CATEGORY_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_CATEGORY_H_ |
6 #define COMPONENTS_NTP_SNIPPETS_CATEGORY_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_CATEGORY_H_ |
7 | 7 |
8 #include <ostream> | 8 #include <ostream> |
9 | 9 |
10 namespace ntp_snippets { | 10 namespace ntp_snippets { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 // Follows the last local category. | 45 // Follows the last local category. |
46 LOCAL_CATEGORIES_COUNT, | 46 LOCAL_CATEGORIES_COUNT, |
47 | 47 |
48 // Remote categories come after this. | 48 // Remote categories come after this. |
49 REMOTE_CATEGORIES_OFFSET = 10000, | 49 REMOTE_CATEGORIES_OFFSET = 10000, |
50 | 50 |
51 // Articles for you. | 51 // Articles for you. |
52 ARTICLES, | 52 ARTICLES, |
53 | 53 |
| 54 // Breaking News |
| 55 BREAKING_NEWS = 10008, |
54 // ****************** INSERT NEW REMOTE CATEGORIES HERE! ****************** | 56 // ****************** INSERT NEW REMOTE CATEGORIES HERE! ****************** |
55 | 57 |
56 // Tracks the last known remote category | 58 // Tracks the last known remote category |
57 LAST_KNOWN_REMOTE_CATEGORY = ARTICLES, | 59 LAST_KNOWN_REMOTE_CATEGORY = BREAKING_NEWS, |
58 }; | 60 }; |
59 | 61 |
60 // A category groups ContentSuggestions which belong together. Use the | 62 // A category groups ContentSuggestions which belong together. Use the |
61 // CategoryFactory to obtain instances. | 63 // CategoryFactory to obtain instances. |
62 class Category { | 64 class Category { |
63 public: | 65 public: |
64 // An arbitrary but consistent ordering. Can be used to look up categories in | 66 // An arbitrary but consistent ordering. Can be used to look up categories in |
65 // a std::map, but should not be used to order categories for other purposes. | 67 // a std::map, but should not be used to order categories for other purposes. |
66 struct CompareByID; | 68 struct CompareByID; |
67 | 69 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 108 |
107 struct Category::CompareByID { | 109 struct Category::CompareByID { |
108 bool operator()(const Category& left, const Category& right) const; | 110 bool operator()(const Category& left, const Category& right) const; |
109 }; | 111 }; |
110 | 112 |
111 std::ostream& operator<<(std::ostream& os, const Category& obj); | 113 std::ostream& operator<<(std::ostream& os, const Category& obj); |
112 | 114 |
113 } // namespace ntp_snippets | 115 } // namespace ntp_snippets |
114 | 116 |
115 #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_H_ | 117 #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_H_ |
OLD | NEW |