OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/ntp_snippets/content_suggestions_category.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 namespace ntp_snippets { |
| 10 |
| 11 ContentSuggestionsCategory::ContentSuggestionsCategory(int id) : id_(id) {} |
| 12 |
| 13 bool ContentSuggestionsCategory::IsKnownCategory( |
| 14 KnownSuggestionsCategories known_category) const { |
| 15 return id_ == static_cast<int>(known_category); |
| 16 } |
| 17 |
| 18 bool operator==(const ContentSuggestionsCategory& left, |
| 19 const ContentSuggestionsCategory& right) { |
| 20 return left.id() == right.id(); |
| 21 } |
| 22 |
| 23 bool operator!=(const ContentSuggestionsCategory& left, |
| 24 const ContentSuggestionsCategory& right) { |
| 25 return !(left == right); |
| 26 } |
| 27 |
| 28 std::ostream& operator<<(std::ostream& os, |
| 29 const ContentSuggestionsCategory& obj) { |
| 30 os << obj.id(); |
| 31 return os; |
| 32 } |
| 33 |
| 34 } // namespace ntp_snippets |
OLD | NEW |