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

Unified Diff: components/offline_pages/offline_page_model_impl.h

Issue 2185973003: [Offline Pages] Delete associated page along with bookmark. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unintended changes. 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 side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/offline_page_model_impl.h
diff --git a/components/offline_pages/offline_page_model_impl.h b/components/offline_pages/offline_page_model_impl.h
index b93a227ebf40a5f09029fd8ffdbd3921eae29da0..acd6579c30a859f3be10d2b849104f4a7728dd64 100644
--- a/components/offline_pages/offline_page_model_impl.h
+++ b/components/offline_pages/offline_page_model_impl.h
@@ -39,6 +39,10 @@ class TimeDelta;
class TimeTicks;
} // namespace base
+namespace bookmarks {
+class BookmarkNode;
+} // namespace bookmarks
+
namespace offline_pages {
static const int64_t kInvalidOfflineId = 0;
@@ -48,6 +52,7 @@ struct OfflinePageItem;
class ArchiveManager;
class ClientPolicyController;
+class OfflinePageBookmarkObserver;
class OfflinePageMetadataStore;
class OfflinePageStorageManager;
@@ -110,6 +115,8 @@ class OfflinePageModelImpl : public OfflinePageModel, public KeyedService {
void ExpirePages(const std::vector<int64_t>& offline_ids,
const base::Time& expiration_time,
const base::Callback<void(bool)>& callback) override;
+ void ExpireRemovedBookmarkPage(const bookmarks::BookmarkNode* node) override;
+ OfflinePageBookmarkObserver* GetBookmarkObserver() override;
ClientPolicyController* GetPolicyController() override;
// Methods for testing only:
@@ -264,6 +271,10 @@ class OfflinePageModelImpl : public OfflinePageModel, public KeyedService {
// Post task to clear storage.
void PostClearStorageIfNeededTask();
+ // Expire associate pages when a bookmark gets deleted.
+ void DoExpireRemovedBookmarkPages(const std::vector<int64_t>& offline_ids);
+ void OnRemovedBookmarkPagesExpired(bool result);
+
void RunWhenLoaded(const base::Closure& job);
// Persistent store for offline page metadata.
@@ -296,6 +307,9 @@ class OfflinePageModelImpl : public OfflinePageModel, public KeyedService {
// Manager for the offline archive files and directory.
std::unique_ptr<ArchiveManager> archive_manager_;
+ // Observer listening events from bookmark model.
+ std::unique_ptr<OfflinePageBookmarkObserver> bookmark_observer_;
+
// Logger to facilitate recording of events.
OfflinePageModelEventLogger offline_event_logger_;

Powered by Google App Engine
This is Rietveld 408576698