| 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 22 matching lines...) Expand all Loading... |
| 33 // |CategoryFactory::FromIDValue(id)|. | 33 // |CategoryFactory::FromIDValue(id)|. |
| 34 // Note that these IDs are not necessarily stable across multiple runs of | 34 // Note that these IDs are not necessarily stable across multiple runs of |
| 35 // the application, so they should not be persisted. | 35 // the application, so they should not be persisted. |
| 36 int id() const { return id_; } | 36 int id() const { return id_; } |
| 37 | 37 |
| 38 bool IsKnownCategory(KnownCategories known_category) const; | 38 bool IsKnownCategory(KnownCategories known_category) const; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 friend class CategoryFactory; | 41 friend class CategoryFactory; |
| 42 | 42 |
| 43 Category(int id); | 43 explicit Category(int id); |
| 44 | 44 |
| 45 int id_; | 45 int id_; |
| 46 | 46 |
| 47 // Allow copy and assignment. | 47 // Allow copy and assignment. |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 bool operator==(const Category& left, const Category& right); | 50 bool operator==(const Category& left, const Category& right); |
| 51 | 51 |
| 52 bool operator!=(const Category& left, const Category& right); | 52 bool operator!=(const Category& left, const Category& right); |
| 53 | 53 |
| 54 std::ostream& operator<<(std::ostream& os, const Category& obj); | 54 std::ostream& operator<<(std::ostream& os, const Category& obj); |
| 55 | 55 |
| 56 } // namespace ntp_snippets | 56 } // namespace ntp_snippets |
| 57 | 57 |
| 58 #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_H_ | 58 #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_H_ |
| OLD | NEW |