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

Unified Diff: ui/base/clipboard/clipboard_mac.mm

Issue 1855583002: Refactor more clipboard/bookmark logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp15_dnd
Patch Set: Comments from avi. Created 4 years, 9 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
Index: ui/base/clipboard/clipboard_mac.mm
diff --git a/ui/base/clipboard/clipboard_mac.mm b/ui/base/clipboard/clipboard_mac.mm
index 08a604122fab438152b02d4c6027ba972041d018..20cdb95396d1a5102a446902d200abc7fa114bde 100644
--- a/ui/base/clipboard/clipboard_mac.mm
+++ b/ui/base/clipboard/clipboard_mac.mm
@@ -426,18 +426,7 @@ void ClipboardMac::WriteBookmark(const char* title_data,
base::scoped_nsobject<NSPasteboardItem> item(
ClipboardUtil::PasteboardItemFromUrl(url, title));
NSPasteboard* pb = GetPasteboard();
-
- NSSet* oldTypes = [NSSet setWithArray:[pb types]];
- NSMutableSet* newTypes = [NSMutableSet setWithArray:[item types]];
- [newTypes minusSet:oldTypes];
-
- [pb addTypes:[newTypes allObjects] owner:nil];
- for (NSString* type in newTypes) {
- // Technically, the object associated with |type| might be an NSString or a
- // property list. It doesn't matter though, since the type gets pulled from
- // and shoved into an NSDictionary.
- [pb setData:[item dataForType:type] forType:type];
- }
+ ui::ClipboardUtil::AddDataToPasteboard(pb, item);
}
void ClipboardMac::WriteBitmap(const SkBitmap& bitmap) {
« no previous file with comments | « components/bookmarks/browser/bookmark_pasteboard_helper_mac.mm ('k') | ui/base/clipboard/clipboard_util_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698