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

Side by Side Diff: chrome/browser/ntp_snippets/bookmark_last_visit_updater.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: Rebase 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 CHROME_BROWSER_NTP_SNIPPETS_BOOKMARK_LAST_VISIT_UPDATER_H_
6 #define CHROME_BROWSER_NTP_SNIPPETS_BOOKMARK_LAST_VISIT_UPDATER_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "content/public/browser/web_contents_observer.h"
12 #include "content/public/browser/web_contents_user_data.h"
13
14 namespace bookmarks {
15 class BookmarkModel;
16 } // namespace bookmarks
17
18 namespace content {
19 class NavigationHandle;
20 class WebContents;
21 } // namespace content
22
23 // A bridge class between platform-specific content::WebContentsObserver and the
24 // generic function ntp_snippets::UpdateBookmarkOnURLVisitedInMainFrame().
25 class BookmarkLastVisitUpdater
26 : public content::WebContentsObserver,
27 public content::WebContentsUserData<BookmarkLastVisitUpdater> {
28 public:
29 ~BookmarkLastVisitUpdater() override;
30
31 static void CreateForWebContentsWithBookmarkModel(
32 content::WebContents* web_contents,
33 bookmarks::BookmarkModel* bookmark_model);
34
35 private:
36 friend class content::WebContentsUserData<BookmarkLastVisitUpdater>;
37
38 explicit BookmarkLastVisitUpdater(content::WebContents* web_contents,
39 bookmarks::BookmarkModel* bookmark_model);
40
41 // Overridden from content::WebContentsObserver:
42 void DidStartNavigation(
43 content::NavigationHandle* navigation_handle) override;
44
45 bookmarks::BookmarkModel* bookmark_model_;
46
47 DISALLOW_COPY_AND_ASSIGN(BookmarkLastVisitUpdater);
48 };
49
50 #endif // CHROME_BROWSER_NTP_SNIPPETS_BOOKMARK_LAST_VISIT_UPDATER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698