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

Unified Diff: components/bookmarks/browser/bookmark_model.cc

Issue 2185973003: [Offline Pages] Delete associated page along with bookmark. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename Owned* to OfflinePageBookmarkObserver and Impl classes. 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/bookmarks/browser/bookmark_model.cc
diff --git a/components/bookmarks/browser/bookmark_model.cc b/components/bookmarks/browser/bookmark_model.cc
index 8d5b238a0c9a1d8cb90266e87f85b2d268dfb6d8..63e23ace3f799cc7c50638fd94bef427493752b0 100644
--- a/components/bookmarks/browser/bookmark_model.cc
+++ b/components/bookmarks/browser/bookmark_model.cc
@@ -24,6 +24,7 @@
#include "components/bookmarks/browser/bookmark_storage.h"
#include "components/bookmarks/browser/bookmark_undo_delegate.h"
#include "components/bookmarks/browser/bookmark_utils.h"
+#include "components/bookmarks/browser/offline_page_bookmark_observer.h"
#include "components/favicon_base/favicon_types.h"
#include "grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
@@ -107,8 +108,11 @@ class EmptyUndoDelegate : public BookmarkUndoDelegate {
// BookmarkModel --------------------------------------------------------------
-BookmarkModel::BookmarkModel(std::unique_ptr<BookmarkClient> client)
+BookmarkModel::BookmarkModel(
+ std::unique_ptr<BookmarkClient> client,
+ std::unique_ptr<OfflinePageBookmarkObserver> offline_page_observer)
: client_(std::move(client)),
+ offline_page_observer_(std::move(offline_page_observer)),
sky 2016/08/29 23:02:43 Why do you need OfflinePageBookmarkObserver bake i
romax 2016/08/29 23:21:24 Because I was thinking that it's better for the Bo
loaded_(false),
root_(GURL()),
bookmark_bar_node_(NULL),
@@ -124,6 +128,8 @@ BookmarkModel::BookmarkModel(std::unique_ptr<BookmarkClient> client)
empty_undo_delegate_(new EmptyUndoDelegate) {
DCHECK(client_);
client_->Init(this);
+ if (offline_page_observer_)
+ AddObserver(offline_page_observer_.get());
}
BookmarkModel::~BookmarkModel() {
« no previous file with comments | « components/bookmarks/browser/bookmark_model.h ('k') | components/bookmarks/browser/offline_page_bookmark_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698