| 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 #ifndef COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_LAST_VISIT_UTILS_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_LAST_VISIT_UTILS_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_LAST_VISIT_UTILS_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_LAST_VISIT_UTILS_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 class GURL; | 10 class GURL; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // to now. If there are multiple bookmarks for a given URL, it updates all of | 24 // to now. If there are multiple bookmarks for a given URL, it updates all of |
| 25 // them. | 25 // them. |
| 26 void UpdateBookmarkOnURLVisitedInMainFrame( | 26 void UpdateBookmarkOnURLVisitedInMainFrame( |
| 27 bookmarks::BookmarkModel* bookmark_model, | 27 bookmarks::BookmarkModel* bookmark_model, |
| 28 const GURL& url); | 28 const GURL& url); |
| 29 | 29 |
| 30 // Gets the last visit date for a given bookmark |node|. If the bookmark lacks | 30 // Gets the last visit date for a given bookmark |node|. If the bookmark lacks |
| 31 // this info, it returns it creation date. | 31 // this info, it returns it creation date. |
| 32 base::Time GetLastVisitDateForBookmark(const bookmarks::BookmarkNode* node); | 32 base::Time GetLastVisitDateForBookmark(const bookmarks::BookmarkNode* node); |
| 33 | 33 |
| 34 // Returns the list of most recently visited bookmarks. For each bookmarked URL, | 34 // Marks all bookmarks with the given URL as dismissed. |
| 35 // it returns the most recently created bookmark. The result is ordered by visit | 35 void MarkBookmarksDismissed(bookmarks::BookmarkModel* bookmark_model, |
| 36 // time (the most recent first). Only bookmarks visited after | 36 const GURL& url); |
| 37 // |min_visit_time| are considered, at most |max_count| bookmarks are returned. | 37 |
| 38 // Gets the dismissed flag for a given bookmark |node|. Defaults to false. |
| 39 bool IsDismissedFromNTPForBookmark(const bookmarks::BookmarkNode* node); |
| 40 |
| 41 // Removes the dismissed flag from all bookmarks (only for debugging). |
| 42 void MarkAllBookmarksUndismissed(bookmarks::BookmarkModel* bookmark_model); |
| 43 |
| 44 // Returns the list of most recently visited, non-dismissed bookmarks. |
| 45 // For each bookmarked URL, it returns the most recently created bookmark. |
| 46 // The result is ordered by visit time (the most recent first). Only bookmarks |
| 47 // visited after |min_visit_time| are considered, at most |max_count| bookmarks |
| 48 // are returned. |
| 38 std::vector<const bookmarks::BookmarkNode*> GetRecentlyVisitedBookmarks( | 49 std::vector<const bookmarks::BookmarkNode*> GetRecentlyVisitedBookmarks( |
| 39 bookmarks::BookmarkModel* bookmark_model, | 50 bookmarks::BookmarkModel* bookmark_model, |
| 40 int max_count, | 51 int max_count, |
| 41 const base::Time& min_visit_time); | 52 const base::Time& min_visit_time); |
| 42 | 53 |
| 54 // Returns the list of all dismissed bookmarks. Only used for debugging. |
| 55 std::vector<const bookmarks::BookmarkNode*> GetDismissedBookmarksForDebugging( |
| 56 bookmarks::BookmarkModel* bookmark_model); |
| 57 |
| 43 } // namespace ntp_snippets | 58 } // namespace ntp_snippets |
| 44 | 59 |
| 45 #endif // COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_LAST_VISIT_UTILS_H_ | 60 #endif // COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_LAST_VISIT_UTILS_H_ |
| OLD | NEW |