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

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

Issue 6798006: Makes the other bookmark folder menu close if you delete the last item (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_context_menu.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7e2bd502b026df977c8bbc8fa359fe1fd837fa35..1468dfbb5b43ee0eda6b1d41a297fcc4da1bdc11 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc
@@ -7,6 +7,7 @@
#include "base/i18n/rtl.h"
#include "base/utf_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
+#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/profiles/profile.h"
#include "content/common/notification_service.h"
#include "grit/generated_resources.h"
@@ -27,6 +28,7 @@ BookmarkContextMenu::BookmarkContextMenu(
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) {
controller_->BuildMenu();
}
@@ -62,7 +64,10 @@ bool BookmarkContextMenu::IsCommandEnabled(int command_id) const {
}
bool BookmarkContextMenu::ShouldCloseAllMenusOnExecute(int id) {
- return id != IDC_BOOKMARK_BAR_REMOVE;
+ return id != IDC_BOOKMARK_BAR_REMOVE ||
+ (parent_node_ ==
+ controller_->profile()->GetBookmarkModel()->other_node() &&
+ parent_node_->child_count() == 1);
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_context_menu.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698