| 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 #include "components/ntp_snippets/content_suggestion.h" | 5 #include "components/ntp_snippets/content_suggestion.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 namespace ntp_snippets { | 9 namespace ntp_snippets { |
| 10 | 10 |
| 11 DownloadSuggestionExtra::DownloadSuggestionExtra() = default; |
| 12 |
| 13 DownloadSuggestionExtra::~DownloadSuggestionExtra() = default; |
| 14 |
| 11 bool ContentSuggestion::ID::operator==(const ID& rhs) const { | 15 bool ContentSuggestion::ID::operator==(const ID& rhs) const { |
| 12 return category_ == rhs.category_ && | 16 return category_ == rhs.category_ && |
| 13 id_within_category_ == rhs.id_within_category_; | 17 id_within_category_ == rhs.id_within_category_; |
| 14 } | 18 } |
| 15 | 19 |
| 16 bool ContentSuggestion::ID::operator!=(const ID& rhs) const { | 20 bool ContentSuggestion::ID::operator!=(const ID& rhs) const { |
| 17 return !(*this == rhs); | 21 return !(*this == rhs); |
| 18 } | 22 } |
| 19 | 23 |
| 20 ContentSuggestion::ContentSuggestion(const ID& id, const GURL& url) | 24 ContentSuggestion::ContentSuggestion(const ID& id, const GURL& url) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 42 download_suggestion_extra_ = std::move(download_suggestion_extra); | 46 download_suggestion_extra_ = std::move(download_suggestion_extra); |
| 43 } | 47 } |
| 44 | 48 |
| 45 void ContentSuggestion::set_recent_tab_suggestion_extra( | 49 void ContentSuggestion::set_recent_tab_suggestion_extra( |
| 46 std::unique_ptr<RecentTabSuggestionExtra> recent_tab_suggestion_extra) { | 50 std::unique_ptr<RecentTabSuggestionExtra> recent_tab_suggestion_extra) { |
| 47 DCHECK(id_.category().IsKnownCategory(KnownCategories::RECENT_TABS)); | 51 DCHECK(id_.category().IsKnownCategory(KnownCategories::RECENT_TABS)); |
| 48 recent_tab_suggestion_extra_ = std::move(recent_tab_suggestion_extra); | 52 recent_tab_suggestion_extra_ = std::move(recent_tab_suggestion_extra); |
| 49 } | 53 } |
| 50 | 54 |
| 51 } // namespace ntp_snippets | 55 } // namespace ntp_snippets |
| OLD | NEW |