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

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: sky's comments 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 <memory>
Marc Treib 2016/08/02 13:37:12 Not needed
Philipp Keck 2016/08/02 14:06:51 Done.
9 #include <vector>
10
11 #include "base/macros.h"
Marc Treib 2016/08/02 13:37:12 Not needed
Philipp Keck 2016/08/02 14:06:51 Done.
12 #include "base/time/time.h"
13 #include "components/bookmarks/browser/bookmark_model.h"
14 #include "components/bookmarks/browser/bookmark_node.h"
Marc Treib 2016/08/02 13:37:12 optional: You could just forward-declare stuff her
Philipp Keck 2016/08/02 14:06:51 Done.
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(const bookmarks::BookmarkNode* node);
28
29 // Returns the list of most recently visited bookmarks. For each bookmarked URL,
30 // it returns the most recently created bookmark. The result is ordered by visit
31 // time (the most recent first). Only bookmarks visited after
32 // |min_visit_time| are considered, at most |max_count| bookmarks are returned.
33 std::vector<const bookmarks::BookmarkNode*> GetRecentlyVisitedBookmarks(
34 bookmarks::BookmarkModel* bookmark_model,
35 int max_count,
36 const base::Time& min_visit_time);
37
38 } // namespace ntp_snippets
39
40 #endif // COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_LAST_VISIT_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698