| 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|. The visit when the | 30 // Gets the last visit date for a given bookmark |node|. The visit when the |
| 31 // bookmark is created also counts. If no info about last visit date is present | 31 // bookmark is created also counts. If no info about last visit date is present |
| 32 // and |creation_date_fallback| is true, creation date is used. | 32 // and |creation_date_fallback| is true, creation date is used. |
| 33 base::Time GetLastVisitDateForBookmark(const bookmarks::BookmarkNode* node, | 33 base::Time GetLastVisitDateForBookmark(const bookmarks::BookmarkNode* node, |
| 34 bool creation_date_fallback = true); | 34 bool creation_date_fallback); |
| 35 | 35 |
| 36 // Like GetLastVisitDateForBookmark, but it returns the unix epoch if the | 36 // Like GetLastVisitDateForBookmark, but it returns the unix epoch if the |
| 37 // bookmark is dismissed from NTP. | 37 // bookmark is dismissed from NTP. |
| 38 base::Time GetLastVisitDateForBookmarkIfNotDismissed( | 38 base::Time GetLastVisitDateForBookmarkIfNotDismissed( |
| 39 const bookmarks::BookmarkNode* node, | 39 const bookmarks::BookmarkNode* node, |
| 40 bool creation_date_fallback = true); | 40 bool creation_date_fallback); |
| 41 | 41 |
| 42 // Marks all bookmarks with the given URL as dismissed. | 42 // Marks all bookmarks with the given URL as dismissed. |
| 43 void MarkBookmarksDismissed(bookmarks::BookmarkModel* bookmark_model, | 43 void MarkBookmarksDismissed(bookmarks::BookmarkModel* bookmark_model, |
| 44 const GURL& url); | 44 const GURL& url); |
| 45 | 45 |
| 46 // Gets the dismissed flag for a given bookmark |node|. Defaults to false. | 46 // Gets the dismissed flag for a given bookmark |node|. Defaults to false. |
| 47 bool IsDismissedFromNTPForBookmark(const bookmarks::BookmarkNode* node); | 47 bool IsDismissedFromNTPForBookmark(const bookmarks::BookmarkNode* node); |
| 48 | 48 |
| 49 // Removes the dismissed flag from all bookmarks (only for debugging). | 49 // Removes the dismissed flag from all bookmarks (only for debugging). |
| 50 void MarkAllBookmarksUndismissed(bookmarks::BookmarkModel* bookmark_model); | 50 void MarkAllBookmarksUndismissed(bookmarks::BookmarkModel* bookmark_model); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 61 int max_count, | 61 int max_count, |
| 62 const base::Time& min_visit_time); | 62 const base::Time& min_visit_time); |
| 63 | 63 |
| 64 // Returns the list of all dismissed bookmarks. Only used for debugging. | 64 // Returns the list of all dismissed bookmarks. Only used for debugging. |
| 65 std::vector<const bookmarks::BookmarkNode*> GetDismissedBookmarksForDebugging( | 65 std::vector<const bookmarks::BookmarkNode*> GetDismissedBookmarksForDebugging( |
| 66 bookmarks::BookmarkModel* bookmark_model); | 66 bookmarks::BookmarkModel* bookmark_model); |
| 67 | 67 |
| 68 } // namespace ntp_snippets | 68 } // namespace ntp_snippets |
| 69 | 69 |
| 70 #endif // COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_LAST_VISIT_UTILS_H_ | 70 #endif // COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_LAST_VISIT_UTILS_H_ |
| OLD | NEW |