summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/bookmarks/bookmark_context_menu_controller.cc18
-rw-r--r--chrome/browser/bookmarks/bookmark_context_menu_controller.h3
2 files changed, 5 insertions, 16 deletions
diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc
index e54e9f8..6853d6a 100644
--- a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc
+++ b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc
@@ -291,7 +291,6 @@ void BookmarkContextMenuController::AddCheckboxItem(int id) {
}
void BookmarkContextMenuController::ExecuteCommand(int id) {
- BookmarkModel* model = RemoveModelObserver();
if (delegate_)
delegate_->WillExecuteCommand();
@@ -346,7 +345,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) {
UserMetrics::RecordAction("BookmarkBar_ContextMenu_Remove", profile_);
for (size_t i = 0; i < selection_.size(); ++i) {
- model->Remove(selection_[i]->GetParent(),
+ model_->Remove(selection_[i]->GetParent(),
selection_[i]->GetParent()->IndexOfChild(selection_[i]));
}
selection_.clear();
@@ -403,15 +402,15 @@ void BookmarkContextMenuController::ExecuteCommand(int id) {
case IDS_BOOKMARK_MANAGER_SORT:
UserMetrics::RecordAction("BookmarkManager_Sort", profile_);
- model->SortChildren(parent_);
+ model_->SortChildren(parent_);
break;
case IDS_CUT:
- bookmark_utils::CopyToClipboard(model, selection_, true);
+ bookmark_utils::CopyToClipboard(model_, selection_, true);
break;
case IDS_COPY:
- bookmark_utils::CopyToClipboard(model, selection_, false);
+ bookmark_utils::CopyToClipboard(model_, selection_, false);
break;
case IDS_PASTE: {
@@ -423,7 +422,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) {
if (selection_.size() == 1 && selection_[0]->is_url())
index = paste_target->IndexOfChild(selection_[0]) + 1;
- bookmark_utils::PasteFromClipboard(model, parent_, index);
+ bookmark_utils::PasteFromClipboard(model_, parent_, index);
break;
}
@@ -533,13 +532,6 @@ void BookmarkContextMenuController::ModelChanged() {
delegate_->CloseMenu();
}
-BookmarkModel* BookmarkContextMenuController::RemoveModelObserver() {
- BookmarkModel* model = model_;
- model_->RemoveObserver(this);
- model_ = NULL;
- return model;
-}
-
bool BookmarkContextMenuController::HasURLs() const {
for (size_t i = 0; i < selection_.size(); ++i) {
if (NodeHasURLs(selection_[i]))
diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller.h b/chrome/browser/bookmarks/bookmark_context_menu_controller.h
index e2e2194..02888f2 100644
--- a/chrome/browser/bookmarks/bookmark_context_menu_controller.h
+++ b/chrome/browser/bookmarks/bookmark_context_menu_controller.h
@@ -125,9 +125,6 @@ class BookmarkContextMenuController : public BookmarkModelObserver,
// Invoked from the various bookmark model observer methods. Closes the menu.
void ModelChanged();
- // Removes the observer from the model and NULLs out model_.
- BookmarkModel* RemoveModelObserver();
-
// Returns true if selection_ has at least one bookmark of type url.
bool HasURLs() const;