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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc

Issue 7076027: Couple more wrench menu issues. The patch I sent around a couple of (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Makes unit test compile Created 9 years, 7 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: chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc b/chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc
index 1468dfbb5b43ee0eda6b1d41a297fcc4da1bdc11..8ac97892c0ab3e6b4e79c89fe4eaefc65d5408b2 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc
@@ -22,14 +22,16 @@ BookmarkContextMenu::BookmarkContextMenu(
Profile* profile,
PageNavigator* page_navigator,
const BookmarkNode* parent,
- const std::vector<const BookmarkNode*>& selection)
+ const std::vector<const BookmarkNode*>& selection,
+ bool close_on_remove)
: ALLOW_THIS_IN_INITIALIZER_LIST(
controller_(new BookmarkContextMenuControllerViews(parent_window,
this, profile, page_navigator, parent, selection))),
parent_window_(parent_window),
ALLOW_THIS_IN_INITIALIZER_LIST(menu_(new views::MenuItemView(this))),
parent_node_(parent),
- observer_(NULL) {
+ observer_(NULL),
+ close_on_remove_(close_on_remove) {
controller_->BuildMenu();
}
@@ -64,10 +66,7 @@ bool BookmarkContextMenu::IsCommandEnabled(int command_id) const {
}
bool BookmarkContextMenu::ShouldCloseAllMenusOnExecute(int id) {
- return id != IDC_BOOKMARK_BAR_REMOVE ||
- (parent_node_ ==
- controller_->profile()->GetBookmarkModel()->other_node() &&
- parent_node_->child_count() == 1);
+ return (id != IDC_BOOKMARK_BAR_REMOVE) || close_on_remove_;
}
////////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698