| 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 15 matching lines...) Expand all Loading... |
| 26 DOWNLOADS, | 26 DOWNLOADS, |
| 27 | 27 |
| 28 // Recently used bookmarks. | 28 // Recently used bookmarks. |
| 29 BOOKMARKS, | 29 BOOKMARKS, |
| 30 | 30 |
| 31 // Physical Web page available in the vicinity. | 31 // Physical Web page available in the vicinity. |
| 32 PHYSICAL_WEB_PAGES, | 32 PHYSICAL_WEB_PAGES, |
| 33 | 33 |
| 34 // Pages recently browsed to on other devices. | 34 // Pages recently browsed to on other devices. |
| 35 FOREIGN_TABS, | 35 FOREIGN_TABS, |
| 36 // INSERT NEW LOCAL CATEGORIES HERE! | 36 |
| 37 // ****************** INSERT NEW LOCAL CATEGORIES HERE! ****************** |
| 38 // Existing categories are persisted and they must never be removed. This may |
| 39 // happen implicitly, e.g. when an older version without some local category |
| 40 // is installed. |
| 37 | 41 |
| 38 // Follows the last local category. | 42 // Follows the last local category. |
| 39 LOCAL_CATEGORIES_COUNT, | 43 LOCAL_CATEGORIES_COUNT, |
| 40 | 44 |
| 41 // Remote categories come after this. | 45 // Remote categories come after this. |
| 42 REMOTE_CATEGORIES_OFFSET = 10000, | 46 REMOTE_CATEGORIES_OFFSET = 10000, |
| 43 | 47 |
| 44 // Articles for you. | 48 // Articles for you. |
| 45 ARTICLES, | 49 ARTICLES, |
| 46 // INSERT NEW REMOTE CATEGORIES HERE! | 50 |
| 51 // ****************** INSERT NEW REMOTE CATEGORIES HERE! ****************** |
| 47 | 52 |
| 48 // Tracks the last known remote category | 53 // Tracks the last known remote category |
| 49 LAST_KNOWN_REMOTE_CATEGORY = ARTICLES, | 54 LAST_KNOWN_REMOTE_CATEGORY = ARTICLES, |
| 50 }; | 55 }; |
| 51 | 56 |
| 52 // A category groups ContentSuggestions which belong together. Use the | 57 // A category groups ContentSuggestions which belong together. Use the |
| 53 // CategoryFactory to obtain instances. | 58 // CategoryFactory to obtain instances. |
| 54 class Category { | 59 class Category { |
| 55 public: | 60 public: |
| 56 // An arbitrary but consistent ordering. Can be used to look up categories in | 61 // An arbitrary but consistent ordering. Can be used to look up categories in |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 103 |
| 99 struct Category::CompareByID { | 104 struct Category::CompareByID { |
| 100 bool operator()(const Category& left, const Category& right) const; | 105 bool operator()(const Category& left, const Category& right) const; |
| 101 }; | 106 }; |
| 102 | 107 |
| 103 std::ostream& operator<<(std::ostream& os, const Category& obj); | 108 std::ostream& operator<<(std::ostream& os, const Category& obj); |
| 104 | 109 |
| 105 } // namespace ntp_snippets | 110 } // namespace ntp_snippets |
| 106 | 111 |
| 107 #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_H_ | 112 #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_H_ |
| OLD | NEW |