| 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_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BOOKMARK_OBSERVER_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/base_bookmark_model_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 OfflinePageBookmarkObserver |
| 27 : public bookmarks::BaseBookmarkModelObserver { |
| 28 public: |
| 29 explicit OfflinePageBookmarkObserver(content::BrowserContext* context); |
| 30 ~OfflinePageBookmarkObserver() override; |
| 31 |
| 32 // Implement bookmarks::OfflinePageBookmarkObserver |
| 33 void BookmarkModelChanged() override; |
| 34 void BookmarkNodeRemoved(bookmarks::BookmarkModel* model, |
| 35 const bookmarks::BookmarkNode* parent, |
| 36 int old_index, |
| 37 const bookmarks::BookmarkNode* node, |
| 38 const std::set<GURL>& removed_urls) override; |
| 39 |
| 40 private: |
| 41 // Does work for actual expiring. |
| 42 void DoExpireRemovedBookmarkPages(const MultipleOfflineIdResult& offline_ids); |
| 43 |
| 44 // Callback for expiring removed bookmark pages. |
| 45 void OnExpireRemovedBookmarkPagesDone(bool result); |
| 46 |
| 47 content::BrowserContext* context_; |
| 48 |
| 49 OfflinePageModel* offline_page_model_; |
| 50 |
| 51 base::WeakPtrFactory<OfflinePageBookmarkObserver> weak_ptr_factory_; |
| 52 }; |
| 53 } // namespace offline_pages |
| 54 |
| 55 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BOOKMARK_OBSERVER_H
_ |
| OLD | NEW |