| 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 COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_BOOKMARK_BRIDGE_H_ | |
| 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_BOOKMARK_BRIDGE_H_ | |
| 7 | |
| 8 #include <set> | |
| 9 | |
| 10 #include "components/bookmarks/browser/base_bookmark_model_observer.h" | |
| 11 | |
| 12 namespace offline_pages { | |
| 13 | |
| 14 class OfflinePageModel; | |
| 15 | |
| 16 // A bridge that adapts the bookmark observer to the OfflinePageModel | |
| 17 class OfflinePageBookmarkBridge : public bookmarks::BaseBookmarkModelObserver { | |
| 18 public: | |
| 19 // constructor, does not take ownership of either pointer. | |
| 20 OfflinePageBookmarkBridge(OfflinePageModel* model, | |
| 21 bookmarks::BookmarkModel* bookmark_model); | |
| 22 | |
| 23 // Overridden from bookmarks::BaseBookmarkModelObserver | |
| 24 void BookmarkModelChanged() override; | |
| 25 // Invoked from the destructor of the BookmarkModel. | |
| 26 void BookmarkModelBeingDeleted(bookmarks::BookmarkModel* model) override; | |
| 27 | |
| 28 void BookmarkNodeAdded(bookmarks::BookmarkModel* model, | |
| 29 const bookmarks::BookmarkNode* parent, | |
| 30 int index) override; | |
| 31 void BookmarkNodeRemoved(bookmarks::BookmarkModel* model, | |
| 32 const bookmarks::BookmarkNode* parent, | |
| 33 int old_index, | |
| 34 const bookmarks::BookmarkNode* node, | |
| 35 const std::set<GURL>& removed_urls) override; | |
| 36 void BookmarkNodeChanged(bookmarks::BookmarkModel* model, | |
| 37 const bookmarks::BookmarkNode* node) override; | |
| 38 | |
| 39 private: | |
| 40 // Not owned. | |
| 41 OfflinePageModel* offline_model_; | |
| 42 bookmarks::BookmarkModel* bookmark_model_; | |
| 43 DISALLOW_COPY_AND_ASSIGN(OfflinePageBookmarkBridge); | |
| 44 }; | |
| 45 } // namespace offline_pages | |
| 46 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_BOOKMARK_BRIDGE_H_ | |
| OLD | NEW |