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

Side by Side Diff: components/ntp_snippets/bookmarks/bookmark_last_visit_utils.h

Issue 2200113002: [New CL] Add a tab helper to record the last visit date for each bookmark (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary explicit Created 4 years, 4 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 unified diff | Download patch
OLDNEW
(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 <vector>
9
10 class GURL;
11
12 namespace base {
13 class Time;
14 } // namespace base
15
16 namespace bookmarks {
17 class BookmarkModel;
18 class BookmarkNode;
19 } // namespace bookmarks
20
21 namespace ntp_snippets {
22
23 // If there is a bookmark for |url|, this function updates its last visit date
24 // to now. If there are multiple bookmarks for a given URL, it updates all of
25 // them.
26 void UpdateBookmarkOnURLVisitedInMainFrame(
27 bookmarks::BookmarkModel* bookmark_model,
28 const GURL& url);
29
30 // Gets the last visit date for a given bookmark |node|. If the bookmark lacks
31 // this info, it returns it creation date.
32 base::Time GetLastVisitDateForBookmark(const bookmarks::BookmarkNode* node);
33
34 // Returns the list of most recently visited bookmarks. For each bookmarked URL,
35 // it returns the most recently created bookmark. The result is ordered by visit
36 // time (the most recent first). Only bookmarks visited after
37 // |min_visit_time| are considered, at most |max_count| bookmarks are returned.
38 std::vector<const bookmarks::BookmarkNode*> GetRecentlyVisitedBookmarks(
39 bookmarks::BookmarkModel* bookmark_model,
40 int max_count,
41 const base::Time& min_visit_time);
42
43 } // namespace ntp_snippets
44
45 #endif // COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_LAST_VISIT_UTILS_H_
OLDNEW
« no previous file with comments | « components/ntp_snippets/bookmarks/DEPS ('k') | components/ntp_snippets/bookmarks/bookmark_last_visit_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698