Bug 1361116 - Ensure that string data is sent to the pasteboard when requested by macOS services. r=mstange, a=jcristau
authorStephen A Pohl <spohl.mozilla.bugs@gmail.com>
Tue, 23 May 2017 00:23:54 -0400
changeset 396455 1db103c1ce1d4b3928c92f4a705e0f5e3dd5bb6f
parent 396454 8a44e418ac5a37f363bbdd7f977531678b3eb92a
child 396456 dc8fbad0237ce5ba415bc9467bb52f96ba93d65c
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, jcristau
bugs1361116
milestone54.0
Bug 1361116 - Ensure that string data is sent to the pasteboard when requested by macOS services. r=mstange, a=jcristau
widget/cocoa/nsChildView.mm
widget/cocoa/nsClipboard.mm
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -6164,16 +6164,18 @@ provideDataForType:(NSString*)aType
                              types:(NSArray *)types
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
 
   nsAutoRetainCocoaObject kungFuDeathGrip(self);
 
   // Make sure that the service will accept strings or HTML.
   if (![types containsObject:
+         [UTIHelper stringFromPboardType:NSStringPboardType]] &&
+      ![types containsObject:
          [UTIHelper stringFromPboardType:NSPasteboardTypeString]] &&
       ![types containsObject:
          [UTIHelper stringFromPboardType:NSPasteboardTypeHTML]]) {
     return NO;
   }
 
   // Bail out if there is no Gecko object.
   if (!mGeckoChild)
--- a/widget/cocoa/nsClipboard.mm
+++ b/widget/cocoa/nsClipboard.mm
@@ -42,16 +42,17 @@ mozilla::StaticRefPtr<nsITransferable> n
   if ([aType isEqualToString:kMozWildcardPboardType] ||
       [aType isEqualToString:kMozCustomTypesPboardType] ||
       [aType isEqualToString:kPublicUrlPboardType] ||
       [aType isEqualToString:kPublicUrlNamePboardType] ||
       [aType isEqualToString:kMozFileUrlsPboardType] ||
       [aType isEqualToString:(NSString*)kPasteboardTypeFileURLPromise] ||
       [aType isEqualToString:(NSString*)kPasteboardTypeFilePromiseContent] ||
       [aType isEqualToString:(NSString*)kUTTypeFileURL] ||
+      [aType isEqualToString:NSStringPboardType] ||
       [aType isEqualToString:NSPasteboardTypeString] ||
       [aType isEqualToString:NSPasteboardTypeHTML] ||
       [aType isEqualToString:NSPasteboardTypeRTF] ||
       [aType isEqualToString:NSPasteboardTypeTIFF] ||
       [aType isEqualToString:NSPasteboardTypePNG]) {
     return [NSString stringWithString:aType];
   }
   NSString* dynamicType =