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); |
} |