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

Unified Diff: components/offline_pages/offline_page_model_impl.cc

Issue 2185973003: [Offline Pages] Delete associated page along with bookmark. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moving to c++. Created 4 years, 5 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.cc
diff --git a/components/offline_pages/offline_page_model_impl.cc b/components/offline_pages/offline_page_model_impl.cc
index a4d63b2595aa929393db9452dd9373ae7f60891c..97db9f0d4be319de5178696ae33a3f71a1b63311 100644
--- a/components/offline_pages/offline_page_model_impl.cc
+++ b/components/offline_pages/offline_page_model_impl.cc
@@ -1068,6 +1068,27 @@ void OfflinePageModelImpl::PostClearStorageIfNeededTask() {
weak_ptr_factory_.GetWeakPtr())));
}
+void OfflinePageModelImpl::BookmarkNodeRemoved(
+ bookmarks::BookmarkModel* model,
+ const bookmarks::BookmarkNode* parent,
+ int old_index,
+ const bookmarks::BookmarkNode* node,
+ const std::set<GURL>& no_longer_bookmarked) {
+ ClientId client_id(kBookmarkNamespace, std::to_string(node->id()));
+ GetOfflineIdsForClientId(
+ client_id, base::Bind(&OfflinePageModelImpl::ExpireRemovedBookmarkPages,
+ weak_ptr_factory_.GetWeakPtr()));
+}
+
+void OfflinePageModelImpl::ExpireRemovedBookmarkPages(
+ const std::vector<int64_t>& offline_ids) {
+ ExpirePages(offline_ids, base::Time::Now(),
+ base::Bind(&OfflinePageModelImpl::OnRemovedBookmarkPagesExpired,
+ weak_ptr_factory_.GetWeakPtr()));
+}
+
+void OfflinePageModelImpl::OnRemovedBookmarkPagesExpired(bool result) {}
+
void OfflinePageModelImpl::RunWhenLoaded(const base::Closure& task) {
if (!is_loaded_) {
delayed_tasks_.push_back(task);

Powered by Google App Engine
This is Rietveld 408576698