| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ntp_snippets_service.h" | 5 #include "components/ntp_snippets/ntp_snippets_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 snippet->best_source().url); | 790 snippet->best_source().url); |
| 791 suggestion.set_amp_url(snippet->best_source().amp_url); | 791 suggestion.set_amp_url(snippet->best_source().amp_url); |
| 792 suggestion.set_title(base::UTF8ToUTF16(snippet->title())); | 792 suggestion.set_title(base::UTF8ToUTF16(snippet->title())); |
| 793 suggestion.set_snippet_text(base::UTF8ToUTF16(snippet->snippet())); | 793 suggestion.set_snippet_text(base::UTF8ToUTF16(snippet->snippet())); |
| 794 suggestion.set_publish_date(snippet->publish_date()); | 794 suggestion.set_publish_date(snippet->publish_date()); |
| 795 suggestion.set_publisher_name( | 795 suggestion.set_publisher_name( |
| 796 base::UTF8ToUTF16(snippet->best_source().publisher_name)); | 796 base::UTF8ToUTF16(snippet->best_source().publisher_name)); |
| 797 suggestion.set_score(snippet->score()); | 797 suggestion.set_score(snippet->score()); |
| 798 result.emplace_back(std::move(suggestion)); | 798 result.emplace_back(std::move(suggestion)); |
| 799 } | 799 } |
| 800 observer_->OnNewSuggestions(provided_category_, std::move(result)); | 800 observer_->OnNewSuggestions(this, provided_category_, std::move(result)); |
| 801 } | 801 } |
| 802 | 802 |
| 803 void NTPSnippetsService::NotifyCategoryStatusChanged() { | 803 void NTPSnippetsService::NotifyCategoryStatusChanged() { |
| 804 if (observer_) { | 804 if (observer_) { |
| 805 observer_->OnCategoryStatusChanged(provided_category_, category_status_); | 805 observer_->OnCategoryStatusChanged(this, provided_category_, |
| 806 category_status_); |
| 806 } | 807 } |
| 807 } | 808 } |
| 808 | 809 |
| 809 } // namespace ntp_snippets | 810 } // namespace ntp_snippets |
| OLD | NEW |