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

Unified Diff: components/bookmarks/browser/bookmark_node_data.cc

Issue 634523004: Allow copying of multiple bookmarks from within the bookmark manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Folders selected only have the name of it copied Created 6 years, 2 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 | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..98f3a80c44c25656f0a399deef808d78d321ccb1 100644
--- a/components/bookmarks/browser/bookmark_node_data.cc
+++ b/components/bookmarks/browser/bookmark_node_data.cc
@@ -177,6 +177,21 @@ 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++) {
+ 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 += i == 0 ? title : base::ASCIIToUTF16("\n") + title;
+ i++;
sky 2014/10/09 16:59:06 Why the i++ here?
hichris123 2014/10/16 00:46:58 Done.
+ }
+ const base::string16 url = base::UTF8ToUTF16(elements[i].url.spec());
+ text += i == 0 ? url : base::ASCIIToUTF16("\n") + url;
+ }
+ scw.WriteText(text);
}
Pickle pickle;
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698