summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-15 14:49:21 +0000
committerjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-15 14:49:21 +0000
commit51d76ac9e348862ad5a70ad7c71f49f9472cef98 (patch)
tree54a3294e779ab98844a8982414eaea45442a2301 /chrome/browser
parentbc5fc9f3e123e4a3c9ca34bc0b0f0341d00a3e05 (diff)
downloadchromium_src-51d76ac9e348862ad5a70ad7c71f49f9472cef98.zip
chromium_src-51d76ac9e348862ad5a70ad7c71f49f9472cef98.tar.gz
chromium_src-51d76ac9e348862ad5a70ad7c71f49f9472cef98.tar.bz2
Mac: Improve behavior of "Add Folder" contextual menu item.
* "Add Folder" on a current folder now inserts the new folder as the last child of the parent folder rather than it's sibling. * "Add Folder" on the "others" folder works as above. This matches Windows behavior. BUG=40722 TEST=See bug. Review URL: http://codereview.chromium.org/1659003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44650 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/cocoa/bookmark_bar_controller.mm10
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_controller.mm b/chrome/browser/cocoa/bookmark_bar_controller.mm
index bb6895a..f71b65b 100644
--- a/chrome/browser/cocoa/bookmark_bar_controller.mm
+++ b/chrome/browser/cocoa/bookmark_bar_controller.mm
@@ -1382,9 +1382,13 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
const BookmarkNode* senderNode = [self nodeFromMenuItem:sender];
const BookmarkNode* parent = NULL;
int newIndex = 0;
- // If triggered from a folder or mark, that is our sibling.
- // If triggered from the bar, add to the end.
- if (senderNode->type() == BookmarkNode::BOOKMARK_BAR) {
+ // If triggered from the bar, folder or "others" folder - add as a child to
+ // the end.
+ // If triggered from a bookmark, add as next sibling.
+ BookmarkNode::Type type = senderNode->type();
+ if (type == BookmarkNode::BOOKMARK_BAR ||
+ type == BookmarkNode::OTHER_NODE ||
+ type == BookmarkNode::FOLDER) {
parent = senderNode;
newIndex = parent->GetChildCount();
} else {