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 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 explicit BookmarkLastVisitUpdater(content::WebContents* web_contents, | |
37 bookmarks::BookmarkModel* bookmark_model); | |
38 friend class content::WebContentsUserData<BookmarkLastVisitUpdater>; | |
Marc Treib
2016/08/02 13:37:11
nit: empty line before. I also think the friend de
Philipp Keck
2016/08/02 14:06:51
Done.
| |
39 | |
40 // Overridden from content::WebContentsObserver: | |
41 void DidStartNavigation( | |
42 content::NavigationHandle* navigation_handle) override; | |
43 | |
44 bookmarks::BookmarkModel* bookmark_model_; | |
45 | |
46 DISALLOW_COPY_AND_ASSIGN(BookmarkLastVisitUpdater); | |
47 }; | |
48 | |
49 #endif // CHROME_BROWSER_NTP_SNIPPETS_BOOKMARK_LAST_VISIT_UPDATER_H_ | |
OLD | NEW |