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

Unified Diff: components/undo/bookmark_undo_service.cc

Issue 1367063004: Support undoing offline page deletion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/undo/bookmark_undo_service.cc
diff --git a/components/undo/bookmark_undo_service.cc b/components/undo/bookmark_undo_service.cc
index 28fd451d7b080d5f6fe434629ab07f14c538ee20..789c042d2cb09864ccee01900551a3203bdf9fb3 100644
--- a/components/undo/bookmark_undo_service.cc
+++ b/components/undo/bookmark_undo_service.cc
@@ -402,17 +402,21 @@ void BookmarkReorderOperation::OnBookmarkRenumbered(int64 old_id,
// BookmarkUndoService --------------------------------------------------------
-BookmarkUndoService::BookmarkUndoService() : scoped_observer_(this) {
+BookmarkUndoService::BookmarkUndoService()
+ : model_(NULL), scoped_observer_(this) {
}
BookmarkUndoService::~BookmarkUndoService() {
}
void BookmarkUndoService::Start(BookmarkModel* model) {
+ DCHECK(!model_);
+ model_ = model;
scoped_observer_.Add(model);
}
void BookmarkUndoService::Shutdown() {
+ model_ = NULL;
scoped_observer_.RemoveAll();
}
@@ -492,4 +496,7 @@ void BookmarkUndoService::OnBookmarkRenumbered(int64 old_id, int64 new_id) {
static_cast<BookmarkUndoOperation*>(op)
->OnBookmarkRenumbered(old_id, new_id);
}
+
+ if (model_)
+ model_->OnBookmarkRenumbered(old_id, new_id);
}

Powered by Google App Engine
This is Rietveld 408576698