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

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: 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..805b1c7be5c2bfbde8878f6661068fabb4f05b1d 100644
--- a/components/bookmarks/browser/bookmark_node_data.cc
+++ b/components/bookmarks/browser/bookmark_node_data.cc
@@ -179,6 +179,26 @@ void BookmarkNodeData::WriteToClipboard(ui::ClipboardType clipboard_type) {
scw.WriteText(base::UTF8ToUTF16(url));
}
sky 2014/10/07 21:58:57 See style guide for handling of else. Basically yo
hichris123 2014/10/08 01:04:28 Done.
+ // We have more than one element
sky 2014/10/07 21:58:57 This comment isn't quite right.
hichris123 2014/10/08 01:04:28 Done.
+ else {
+ bool all_urls = true;
sky 2014/10/07 21:58:57 What's the rationale for this logic? Why ignore fo
hichris123 2014/10/07 22:35:55 I just tried not including folders, and it wouldn'
hichris123 2014/10/08 01:04:29 Done.
+ for (Element& element : elements) {
+ if (!element.is_url) {
+ all_urls = false;
+ break;
+ }
+ }
+
+ if (all_urls == true) {
sky 2014/10/07 21:58:57 No == true here, just if (all_urls)
hichris123 2014/10/08 01:04:28 Done.
+ std::string text;
+ for (size_t i = 0; i < elements.size(); i++) {
+ const std::string url = elements[i].url.spec();
+ text += i == 0 ? url : "\n" + url;
+ }
+ scw.WriteText(base::UTF8ToUTF16(text));
+ }
+ }
+
Pickle pickle;
WriteToPickle(base::FilePath(), &pickle);
scw.WritePickledData(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