| 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 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 // Follows the last local category. | 40 // Follows the last local category. |
| 41 LOCAL_CATEGORIES_COUNT, | 41 LOCAL_CATEGORIES_COUNT, |
| 42 | 42 |
| 43 // Remote categories come after this. | 43 // Remote categories come after this. |
| 44 REMOTE_CATEGORIES_OFFSET = 10000, | 44 REMOTE_CATEGORIES_OFFSET = 10000, |
| 45 | 45 |
| 46 // Articles for you. | 46 // Articles for you. |
| 47 ARTICLES, | 47 ARTICLES, |
| 48 // INSERT NEW REMOTE CATEGORIES HERE! | 48 // INSERT NEW REMOTE CATEGORIES HERE! |
| 49 |
| 50 // Tracks the last known remote category |
| 51 LAST_KNOWN_REMOTE_CATEGORY = ARTICLES, |
| 49 }; | 52 }; |
| 50 | 53 |
| 51 // A category groups ContentSuggestions which belong together. Use the | 54 // A category groups ContentSuggestions which belong together. Use the |
| 52 // CategoryFactory to obtain instances. | 55 // CategoryFactory to obtain instances. |
| 53 class Category { | 56 class Category { |
| 54 public: | 57 public: |
| 55 // An arbitrary but consistent ordering. Can be used to look up categories in | 58 // An arbitrary but consistent ordering. Can be used to look up categories in |
| 56 // a std::map, but should not be used to order categories for other purposes. | 59 // a std::map, but should not be used to order categories for other purposes. |
| 57 struct CompareByID; | 60 struct CompareByID; |
| 58 | 61 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 80 | 83 |
| 81 struct Category::CompareByID { | 84 struct Category::CompareByID { |
| 82 bool operator()(const Category& left, const Category& right) const; | 85 bool operator()(const Category& left, const Category& right) const; |
| 83 }; | 86 }; |
| 84 | 87 |
| 85 std::ostream& operator<<(std::ostream& os, const Category& obj); | 88 std::ostream& operator<<(std::ostream& os, const Category& obj); |
| 86 | 89 |
| 87 } // namespace ntp_snippets | 90 } // namespace ntp_snippets |
| 88 | 91 |
| 89 #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_H_ | 92 #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_H_ |
| OLD | NEW |