Index: components/bookmarks/browser/bookmark_node_data.cc |
diff --git a/components/bookmarks/browser/bookmark_node_data.cc b/components/bookmarks/browser/bookmark_node_data.cc |
index 8d0d1430d459eabccf34bf733897a5503642eaf8..28c588c72d8f5e60aa7d100f5adbf036c9eeab17 100644 |
--- a/components/bookmarks/browser/bookmark_node_data.cc |
+++ b/components/bookmarks/browser/bookmark_node_data.cc |
@@ -177,6 +177,22 @@ void BookmarkNodeData::WriteToClipboard(ui::ClipboardType clipboard_type) { |
// on Linux (on Windows and Mac, there is no difference between these |
// functions). |
scw.WriteText(base::UTF8ToUTF16(url)); |
+ } else { |
+ // We have either more than one URL, a folder, or a combination of URLs |
+ // and folders. |
+ base::string16 text; |
+ for (size_t i = 0; i < elements.size(); i++) { |
+ text += i == 0 ? base::ASCIIToUTF16("") : base::ASCIIToUTF16("\n"); |
+ if (!elements[i].is_url) { |
+ // Then it's a folder. Only copy the name of the folder. |
+ const base::string16 title = elements[i].title; |
+ text += title; |
+ } else { |
+ const base::string16 url = base::UTF8ToUTF16(elements[i].url.spec()); |
+ text += url; |
+ } |
+ } |
+ scw.WriteText(text); |
} |
Pickle pickle; |