| 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 { |
| 11 | 11 |
| 12 class CategoryFactory; | 12 class CategoryFactory; |
| 13 | 13 |
| 14 // These are the categories that the client knows about. | 14 // These are the categories that the client knows about. |
| 15 // The values before LOCAL_CATEGORIES_COUNT are the categories that are provided | 15 // The values before LOCAL_CATEGORIES_COUNT are the categories that are provided |
| 16 // locally on the device. Categories provided by the server (IDs strictly larger | 16 // locally on the device. Categories provided by the server (IDs strictly larger |
| 17 // than REMOTE_CATEGORIES_OFFSET) only need to be hard-coded here if they need | 17 // than REMOTE_CATEGORIES_OFFSET) only need to be hard-coded here if they need |
| 18 // to be recognized by the client implementation. | 18 // to be recognized by the client implementation. |
| 19 enum class KnownCategories { | 19 enum class KnownCategories { |
| 20 OFFLINE_PAGES, | 20 OFFLINE_PAGES, |
| 21 BOOKMARKS, |
| 21 LOCAL_CATEGORIES_COUNT, | 22 LOCAL_CATEGORIES_COUNT, |
| 22 | 23 |
| 23 REMOTE_CATEGORIES_OFFSET = 10000, | 24 REMOTE_CATEGORIES_OFFSET = 10000, |
| 24 ARTICLES = REMOTE_CATEGORIES_OFFSET + 1, | 25 ARTICLES = REMOTE_CATEGORIES_OFFSET + 1, |
| 25 }; | 26 }; |
| 26 | 27 |
| 27 // A category groups ContentSuggestions which belong together. Use the | 28 // A category groups ContentSuggestions which belong together. Use the |
| 28 // CategoryFactory to obtain instances. | 29 // CategoryFactory to obtain instances. |
| 29 class Category { | 30 class Category { |
| 30 public: | 31 public: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 49 | 50 |
| 50 bool operator==(const Category& left, const Category& right); | 51 bool operator==(const Category& left, const Category& right); |
| 51 | 52 |
| 52 bool operator!=(const Category& left, const Category& right); | 53 bool operator!=(const Category& left, const Category& right); |
| 53 | 54 |
| 54 std::ostream& operator<<(std::ostream& os, const Category& obj); | 55 std::ostream& operator<<(std::ostream& os, const Category& obj); |
| 55 | 56 |
| 56 } // namespace ntp_snippets | 57 } // namespace ntp_snippets |
| 57 | 58 |
| 58 #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_H_ | 59 #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_H_ |
| OLD | NEW |