summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfeldstein@chromium.org <feldstein@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-02 19:35:05 +0000
committerfeldstein@chromium.org <feldstein@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-02 19:35:05 +0000
commit511cc0d4031024b45c1eb97ae6971217f2ef5994 (patch)
tree1f65beebee2aaf52e9be4177211acd9951e9df1d
parent59f6749a6df399704ac85485f8c7864b771daa58 (diff)
downloadchromium_src-511cc0d4031024b45c1eb97ae6971217f2ef5994.zip
chromium_src-511cc0d4031024b45c1eb97ae6971217f2ef5994.tar.gz
chromium_src-511cc0d4031024b45c1eb97ae6971217f2ef5994.tar.bz2
Fix copying/dragging of empty folders in BMM on mac
The code was assuming there was at least one url. There is still a js error in the BMM on all platforms that I've run into a couple of times, but I want to check this in while I look into that. BUG=39229 TEST=Copy or drag an empty bookmarks folder Review URL: http://codereview.chromium.org/1456003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43510 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm4
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm b/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm
index 4d3416f..dd8f938 100644
--- a/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm
+++ b/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm
@@ -201,6 +201,10 @@ void WriteSimplifiedBookmarkTypes(NSPasteboard* pb,
NSMutableArray* urls = [NSMutableArray array];
FillFlattenedArraysForBookmarks(elements, titles, urls);
+ // These bookmark types only act on urls, not folders.
+ if ([urls count] < 1)
+ return;
+
// Write WebURLsWithTitlesPboardType.
[pb setPropertyList:[NSArray arrayWithObjects:urls, titles, nil]
forType:kWebURLsWithTitlesPboardType];