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

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

Issue 2094553003: [Merge to 2743] [Mac] Fix regression with copying URLs from the Omnibox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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 | « no previous file | ui/base/clipboard/clipboard_util_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/clipboard/clipboard_util_mac.mm
diff --git a/ui/base/clipboard/clipboard_util_mac.mm b/ui/base/clipboard/clipboard_util_mac.mm
index 7d0d774122cf62d73267b9c9b7a3b510ff745f46..a5c796e54cd98db2faeca250c0ec99d390c4b539 100644
--- a/ui/base/clipboard/clipboard_util_mac.mm
+++ b/ui/base/clipboard/clipboard_util_mac.mm
@@ -9,10 +9,8 @@
namespace {
NSString* const kWebURLsWithTitlesPboardType = @"WebURLsWithTitlesPboardType";
-NSString* const kCorePasteboardFlavorType_url =
- @"CorePasteboardFlavorType 0x75726C20"; // 'url ' url
-NSString* const kCorePasteboardFlavorType_urln =
- @"CorePasteboardFlavorType 0x75726C6E"; // 'urln' title
+NSString* const kPublicUrl = @"public.url";
+NSString* const kPublicUrlName = @"public.url-name";
// It's much more convenient to return an NSString than a
// base::ScopedCFTypeRef<CFStringRef>, since the methods on NSPasteboardItem
@@ -68,12 +66,8 @@ base::scoped_nsobject<NSPasteboardItem> ClipboardUtil::PasteboardItemFromUrl(
}
[item setString:urlString forType:NSPasteboardTypeString];
-
- [item setData:[urlString dataUsingEncoding:NSUTF8StringEncoding]
- forType:UTIFromPboardType(kCorePasteboardFlavorType_url)];
-
- [item setData:[title dataUsingEncoding:NSUTF8StringEncoding]
- forType:UTIFromPboardType(kCorePasteboardFlavorType_urln)];
+ [item setString:urlString forType:kPublicUrl];
+ [item setString:title forType:kPublicUrlName];
return item;
}
@@ -101,14 +95,12 @@ base::scoped_nsobject<NSPasteboardItem> ClipboardUtil::PasteboardItemFromString(
//static
NSString* ClipboardUtil::GetTitleFromPasteboardURL(NSPasteboard* pboard) {
- return
- [pboard stringForType:UTIFromPboardType(kCorePasteboardFlavorType_urln)];
+ return [pboard stringForType:kPublicUrlName];
}
//static
NSString* ClipboardUtil::GetURLFromPasteboardURL(NSPasteboard* pboard) {
- return
- [pboard stringForType:UTIFromPboardType(kCorePasteboardFlavorType_url)];
+ return [pboard stringForType:kPublicUrl];
}
// static
« no previous file with comments | « no previous file | ui/base/clipboard/clipboard_util_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698