OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_LAST_VISIT_UTILS_H_ | |
6 #define COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_LAST_VISIT_UTILS_H_ | |
7 | |
8 #include <memory> | |
9 #include <vector> | |
10 | |
11 #include "base/macros.h" | |
12 #include "base/time/time.h" | |
13 #include "components/bookmarks/browser/bookmark_model.h" | |
14 #include "components/bookmarks/browser/bookmark_node.h" | |
15 | |
16 namespace ntp_snippets { | |
17 | |
18 // If there is a bookmark for |url|, this function updates its last visit date | |
19 // to now. If there are multiple bookmarks for a given URL, it updates all of | |
20 // them. | |
21 void UpdateBookmarkOnURLVisitedInMainFrame( | |
22 bookmarks::BookmarkModel* bookmark_model, | |
23 const GURL& url); | |
24 | |
25 // Gets the last visit date for a given bookmark |node|. If the bookmark lacks | |
26 // this info, it returns it creation date. | |
27 base::Time GetLastVisitDateForBookmark( | |
28 const bookmarks::BookmarkNode* node); | |
29 | |
30 // Returns the list of most recently visited bookmarked URLs. For each such URL | |
Marc Treib
2016/07/30 14:38:09
nit: It really returns the bookmarks, not just the
Philipp Keck
2016/08/02 13:05:33
Done.
| |
31 // it returns the most recently created bookmark. The result is ordered by visit | |
32 // time (the most recent first). Only bookmarked URLs visited after | |
33 // |min_visit_time| are considered, at most |max_count| bookmarks are returned. | |
34 std::vector<const bookmarks::BookmarkNode*> GetRecentlyVisitedBookmarks( | |
35 bookmarks::BookmarkModel* bookmark_model, | |
36 int max_count, | |
37 const base::Time& min_visit_time); | |
38 | |
39 } // namespace ntp_snippets | |
40 | |
41 #endif // COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_LAST_VISIT_UTILS_H_ | |
OLD | NEW |