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

Unified Diff: components/ntp_snippets/bookmarks/bookmark_last_visit_utils.cc

Issue 2305583002: Do not select old bookmarks in ntp_snippets::BookmarkSuggestionsProvider (Closed)
Patch Set: Marc's comments. Created 4 years, 3 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
Index: components/ntp_snippets/bookmarks/bookmark_last_visit_utils.cc
diff --git a/components/ntp_snippets/bookmarks/bookmark_last_visit_utils.cc b/components/ntp_snippets/bookmarks/bookmark_last_visit_utils.cc
index bd1b3888a16364d4daa727474a3f5443a09841b7..ed94a9bb493cd793af6e5e79b0368e0174dfd657 100644
--- a/components/ntp_snippets/bookmarks/bookmark_last_visit_utils.cc
+++ b/components/ntp_snippets/bookmarks/bookmark_last_visit_utils.cc
@@ -187,6 +187,12 @@ std::vector<const BookmarkNode*> GetRecentlyVisitedBookmarks(
// Insert the first |max_count| items from |bookmarks| into |result|.
std::vector<const BookmarkNode*> result;
for (const RecentBookmark& bookmark : bookmarks) {
+ if (!creation_date_fallback &&
+ GetLastVisitDateForBookmark(bookmark.node, creation_date_fallback) <
+ min_visit_time) {
+ break;
+ }
+
result.push_back(bookmark.node);
if (result.size() >= static_cast<size_t>(max_count))
break;
« no previous file with comments | « components/ntp_snippets/bookmarks/DEPS ('k') | components/ntp_snippets/bookmarks/bookmark_last_visit_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698