Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
|
Marc Treib
2016/07/29 09:54:57
.
jkrcal
2016/07/29 12:42:42
Done.
| |
| 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_DATE_HELPER_H_ | |
| 6 #define COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_LAST_VISIT_DATE_HELPER_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 using bookmarks::BookmarkModel; | |
| 17 using bookmarks::BookmarkNode; | |
|
Marc Treib
2016/07/29 09:54:57
No using in headers (you can put them into the .cc
jkrcal
2016/07/29 12:42:42
Done.
| |
| 18 | |
| 19 namespace ntp_snippets { | |
| 20 | |
| 21 class BookmarkNavigationObserver { | |
|
Marc Treib
2016/07/29 09:54:57
Any reason for the separate observer interface? Th
jkrcal
2016/07/29 12:42:42
Agreed. Not much persuaded this adds any advantage
| |
| 22 public: | |
| 23 virtual void OnURLVisitedInMainFrame(BookmarkModel* bookmark_model, | |
| 24 const GURL& url); | |
|
Marc Treib
2016/07/29 09:54:57
If you do keep the observer, then this should be p
jkrcal
2016/07/29 12:42:42
Done.
| |
| 25 }; | |
| 26 | |
| 27 // Per-tab class to report visits to bookmarked pages. | |
| 28 class BookmarkLastVisitDateHelper | |
|
tschumann
2016/07/29 10:33:00
so, I'd call this class something like LastVisited
Marc Treib
2016/07/29 10:42:22
I think there's no reason for a class at all, sinc
tschumann
2016/07/29 12:38:56
right, if we don't need a class, then a function w
jkrcal
2016/07/29 12:42:42
Done. I still call the component code "_util" to m
| |
| 29 : public BookmarkNavigationObserver { | |
| 30 public: | |
| 31 BookmarkLastVisitDateHelper() = default; | |
| 32 ~BookmarkLastVisitDateHelper() = default; | |
| 33 | |
| 34 void OnURLVisitedInMainFrame(BookmarkModel* bookmark_model, | |
|
Marc Treib
2016/07/29 09:54:57
The bookmark model will always be the same, right?
jkrcal
2016/07/29 12:42:42
Done global functions.
| |
| 35 const GURL& url) override; | |
| 36 | |
| 37 static base::Time GetLastVisitDate(const BookmarkNode* node); | |
| 38 | |
| 39 static void GetRecentlyVisitedBookmarks( | |
| 40 BookmarkModel* bookmark_model, | |
| 41 std::vector<const BookmarkNode*>* bookmarks, | |
|
Marc Treib
2016/07/29 09:54:57
Just return the vector? (Thanks to move semantics,
jkrcal
2016/07/29 12:42:41
Done.
| |
| 42 int max_count, | |
| 43 const base::Time& min_time); | |
|
Marc Treib
2016/07/29 09:54:57
min_visit_time?
jkrcal
2016/07/29 12:42:42
Done.
| |
| 44 | |
| 45 private: | |
| 46 DISALLOW_COPY_AND_ASSIGN(BookmarkLastVisitDateHelper); | |
| 47 }; | |
| 48 | |
| 49 } // namespace ntp_snippets | |
| 50 | |
| 51 #endif // COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_LAST_VISIT_DATE_HELPER_H_ | |
| OLD | NEW |