| 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_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BOOKMARK_OBSERVER_IMPL
_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BOOKMARK_OBSERVER_IMPL
_H_ |
| 7 |
| 8 #include "base/memory/weak_ptr.h" |
| 9 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h" |
| 10 #include "components/bookmarks/browser/offline_page_bookmark_observer.h" |
| 11 #include "components/offline_pages/offline_page_types.h" |
| 12 |
| 13 class GURL; |
| 14 |
| 15 namespace bookmarks { |
| 16 class BookmarkModel; |
| 17 class BookmarkNode; |
| 18 } |
| 19 |
| 20 namespace content { |
| 21 class BrowserContext; |
| 22 } |
| 23 |
| 24 namespace offline_pages { |
| 25 |
| 26 class OfflinePageBookmarkObserverImpl |
| 27 : public bookmarks::OfflinePageBookmarkObserver { |
| 28 public: |
| 29 explicit OfflinePageBookmarkObserverImpl(content::BrowserContext* context); |
| 30 ~OfflinePageBookmarkObserverImpl() override; |
| 31 |
| 32 // Implement bookmarks::OfflinePageBookmarkObserver |
| 33 void BookmarkNodeRemoved(bookmarks::BookmarkModel* model, |
| 34 const bookmarks::BookmarkNode* parent, |
| 35 int old_index, |
| 36 const bookmarks::BookmarkNode* node, |
| 37 const std::set<GURL>& removed_urls) override; |
| 38 |
| 39 private: |
| 40 // Does work for actual expiring. |
| 41 void DoExpireRemovedBookmarkPages(const MultipleOfflineIdResult& offline_ids); |
| 42 |
| 43 // Callback for expiring removed bookmark pages. |
| 44 void OnExpireRemovedBookmarkPagesDone(bool result); |
| 45 |
| 46 content::BrowserContext* context_; |
| 47 |
| 48 OfflinePageModel* offline_page_model_; |
| 49 |
| 50 base::WeakPtrFactory<OfflinePageBookmarkObserverImpl> weak_ptr_factory_; |
| 51 }; |
| 52 } // namespace offline_pages |
| 53 |
| 54 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BOOKMARK_OBSERVER_I
MPL_H_ |
| OLD | NEW |