Remove "Add to iPhoto" from the action menu's sharing menu
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Oct 2014 20:16:32 +0000 (20:16 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Oct 2014 20:16:32 +0000 (20:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=138251
<rdar://problem/18837197>

Reviewed by Anders Carlsson.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
Filter out "Add to iPhoto".

* platform/spi/mac/NSSharingServiceSPI.h:
Add 'name' to the NSSharingService SPI header.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175417 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/spi/mac/NSSharingServiceSPI.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WKActionMenuController.mm

index 7d45192b4826ce3923a42ae8ab9939e3d69e554d..df1e0e051a8e98b2bc6bfda67658a782f87c4c72 100644 (file)
@@ -1,3 +1,14 @@
+2014-10-31  Tim Horton  <timothy_horton@apple.com>
+
+        Remove "Add to iPhoto" from the action menu's sharing menu
+        https://bugs.webkit.org/show_bug.cgi?id=138251
+        <rdar://problem/18837197>
+
+        Reviewed by Anders Carlsson.
+
+        * platform/spi/mac/NSSharingServiceSPI.h:
+        Add 'name' to the NSSharingService SPI header.
+
 2014-10-31  Akos Kiss  <akiss@inf.u-szeged.hu>
 
         Fix type clash warning in supports_error rule of CSSGrammar.
index ef9210f340dc5840225c34b0f85ec3c27c57f86f..12f4a9a6e533cd8127bcd5deb60efde3b096b186 100644 (file)
@@ -48,6 +48,7 @@ typedef NS_OPTIONS(NSUInteger, NSSharingServiceMask) {
 @interface NSSharingService (Private)
 + (NSArray *)sharingServicesForItems:(NSArray *)items mask:(NSSharingServiceMask)maskForFiltering;
 @property (readonly) NSSharingServiceType type;
+@property (readwrite, copy) NSString *name;
 @end
 
 #endif
index 618eaf2acb79c16773774202d83c55f01132052e..c0ea1cfed04d1f6e308cf1c99cf845fd0257ef2f 100644 (file)
@@ -1,3 +1,15 @@
+2014-10-31  Tim Horton  <timothy_horton@apple.com>
+
+        Remove "Add to iPhoto" from the action menu's sharing menu
+        https://bugs.webkit.org/show_bug.cgi?id=138251
+        <rdar://problem/18837197>
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/mac/WKActionMenuController.mm:
+        (-[WKActionMenuController sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
+        Filter out "Add to iPhoto".
+
 2014-10-31  Adrian Perez de Castro  <aperez@igalia.com>
 
         [GTK] Support script message handlers WebKitUserContentManager
index befd923f11c8cf45f691a6023ab1d7fcd2c9b1d7..3942a468b9530e6124636d82616da31fdadbe815 100644 (file)
@@ -346,6 +346,19 @@ static NSString *pathToPhotoOnDisk(NSString *suggestedFilename)
 
 #pragma mark NSSharingServicePickerDelegate implementation
 
+- (NSArray *)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker sharingServicesForItems:(NSArray *)items mask:(NSSharingServiceMask)mask proposedSharingServices:(NSArray *)proposedServices
+{
+    NSMutableArray *services = [[NSMutableArray alloc] initWithCapacity:proposedServices.count];
+
+    for (NSSharingService *service in proposedServices) {
+        if ([service.name isEqualToString:NSSharingServiceNameAddToIPhoto])
+            continue;
+        [services addObject:service];
+    }
+
+    return services;
+}
+
 - (id <NSSharingServiceDelegate>)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker delegateForSharingService:(NSSharingService *)sharingService
 {
     return self;