Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Unified Diff: components/ntp_snippets/remote/remote_suggestions_provider_impl.cc

Issue 2616543002: Expose notification info in ContentSuggestion (Closed)
Patch Set: Address comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/ntp_snippets/remote/ntp_snippet_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/remote/remote_suggestions_provider_impl.cc
diff --git a/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc b/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc
index 360e70f6e4d2142ec8eef116de67ea27aba167b0..f013e607e7a6c77b2224d336b14727b9d50fc282 100644
--- a/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc
+++ b/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc
@@ -17,7 +17,6 @@
#include "base/path_service.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
-#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/default_clock.h"
#include "base/time/time.h"
@@ -27,7 +26,6 @@
#include "components/image_fetcher/image_decoder.h"
#include "components/image_fetcher/image_fetcher.h"
#include "components/ntp_snippets/category_rankers/category_ranker.h"
-#include "components/ntp_snippets/features.h"
#include "components/ntp_snippets/pref_names.h"
#include "components/ntp_snippets/remote/remote_suggestions_database.h"
#include "components/ntp_snippets/switches.h"
@@ -147,18 +145,7 @@ std::vector<ContentSuggestion> ConvertToContentSuggestions(
if (!snippet->is_complete()) {
continue;
}
- GURL url = snippet->url();
- if (base::FeatureList::IsEnabled(kPreferAmpUrlsFeature) &&
- !snippet->amp_url().is_empty()) {
- url = snippet->amp_url();
- }
- ContentSuggestion suggestion(category, snippet->id(), url);
- suggestion.set_title(base::UTF8ToUTF16(snippet->title()));
- suggestion.set_snippet_text(base::UTF8ToUTF16(snippet->snippet()));
- suggestion.set_publish_date(snippet->publish_date());
- suggestion.set_publisher_name(base::UTF8ToUTF16(snippet->publisher_name()));
- suggestion.set_score(snippet->score());
- result.emplace_back(std::move(suggestion));
+ result.emplace_back(snippet->ToContentSuggestion(category));
}
return result;
}
« no previous file with comments | « components/ntp_snippets/remote/ntp_snippet_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698