Index: base/clipboard_mac.mm |
=================================================================== |
--- base/clipboard_mac.mm (revision 5474) |
+++ base/clipboard_mac.mm (working copy) |
@@ -15,6 +15,10 @@ |
// Would be nice if this were in UTCoreTypes.h, but it isn't |
const NSString* kUTTypeURLName = @"public.url-name"; |
+// Tells us if WebKit was the last to write to the pasteboard. There's no |
+// actual data associated with this type. |
+const NSString *kWebSmartPastePboardType = @"NeXT smart paste pasteboard type"; |
+ |
NSPasteboard* GetPasteboard() { |
// The pasteboard should not be nil in a UI session, but this handy DCHECK |
// can help track down problems if someone tries using clipboard code outside |
@@ -121,6 +125,14 @@ |
[pb setPropertyList:fileList forType:NSFilenamesPboardType]; |
} |
+// Write an extra flavor that signifies WebKit was the last to modify the |
+// pasteboard. This flavor has no data. |
+void Clipboard::WriteWebSmartPaste() { |
+ NSPasteboard* pb = GetPasteboard(); |
+ [pb addTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; |
+ [pb setData:nil forType:GetWebKitSmartPasteFormatType()]; |
+} |
+ |
bool Clipboard::IsFormatAvailable(NSString* format) const { |
NSPasteboard* pb = GetPasteboard(); |
NSArray* types = [pb types]; |
@@ -250,3 +262,8 @@ |
Clipboard::FormatType Clipboard::GetHtmlFormatType() { |
return NSHTMLPboardType; |
} |
+ |
+// static |
+Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() { |
+ return kWebSmartPastePboardType; |
+} |