Chromium Code Reviews| 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 must never be removed. This happens easily if you | |
| 39 // switch out of a local branch that contains a new category. If you cannot | |
| 40 // avoid it, consider forcing ConstantCategoryRanker via chrome://flags. | |
| 41 // Otherwise, Chrome will crash and you would need to reinstall it to fix it. | |
|
vitaliii
2017/02/08 08:40:35
Jumping directly to "switching out of a local bran
jkrcal
2017/02/08 10:12:05
Done.
| |
| 37 | 42 |
| 38 // Follows the last local category. | 43 // Follows the last local category. |
| 39 LOCAL_CATEGORIES_COUNT, | 44 LOCAL_CATEGORIES_COUNT, |
| 40 | 45 |
| 41 // Remote categories come after this. | 46 // Remote categories come after this. |
| 42 REMOTE_CATEGORIES_OFFSET = 10000, | 47 REMOTE_CATEGORIES_OFFSET = 10000, |
| 43 | 48 |
| 44 // Articles for you. | 49 // Articles for you. |
| 45 ARTICLES, | 50 ARTICLES, |
| 46 // INSERT NEW REMOTE CATEGORIES HERE! | 51 |
| 52 // ****************** INSERT NEW REMOTE CATEGORIES HERE! ****************** | |
| 47 | 53 |
| 48 // Tracks the last known remote category | 54 // Tracks the last known remote category |
| 49 LAST_KNOWN_REMOTE_CATEGORY = ARTICLES, | 55 LAST_KNOWN_REMOTE_CATEGORY = ARTICLES, |
| 50 }; | 56 }; |
| 51 | 57 |
| 52 // A category groups ContentSuggestions which belong together. Use the | 58 // A category groups ContentSuggestions which belong together. Use the |
| 53 // CategoryFactory to obtain instances. | 59 // CategoryFactory to obtain instances. |
| 54 class Category { | 60 class Category { |
| 55 public: | 61 public: |
| 56 // An arbitrary but consistent ordering. Can be used to look up categories in | 62 // 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 | 104 |
| 99 struct Category::CompareByID { | 105 struct Category::CompareByID { |
| 100 bool operator()(const Category& left, const Category& right) const; | 106 bool operator()(const Category& left, const Category& right) const; |
| 101 }; | 107 }; |
| 102 | 108 |
| 103 std::ostream& operator<<(std::ostream& os, const Category& obj); | 109 std::ostream& operator<<(std::ostream& os, const Category& obj); |
| 104 | 110 |
| 105 } // namespace ntp_snippets | 111 } // namespace ntp_snippets |
| 106 | 112 |
| 107 #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_H_ | 113 #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_H_ |
| OLD | NEW |