Changeset 238941 in webkit
- Timestamp:
- Dec 6, 2018 2:11:45 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r238939 r238941 1 2018-12-06 Tim Horton <timothy_horton@apple.com> 2 3 Web Share API: share overlay does not stick to the Safari window 4 https://bugs.webkit.org/show_bug.cgi?id=192469 5 <rdar://problem/46074833> 6 7 Reviewed by Wenson Hsieh. 8 9 * UIProcess/Cocoa/WKShareSheet.mm: 10 (-[WKShareSheet sharingServicePicker:didChooseSharingService:]): 11 (-[WKShareSheet sharingServicePicker:delegateForSharingService:]): 12 (-[WKShareSheet sharingService:sourceWindowForShareItems:sharingContentScope:]): 13 (-[WKShareSheet sharingService:didFailToShareItems:error:]): 14 (-[WKShareSheet sharingService:didShareItems:]): 15 Implement another NSSharingServicePickerDelegate method to return 16 an *NSSharingService* delegate when needed. 17 18 Implement an NSSharingServiceDelegate method to return the window that 19 the service's UI should attach to. 20 21 Also, instead of notifying the Web Content process when a service is picked 22 (or not) in the NSSharingServicePicker, wait until the share has completed 23 (or failed) to send didComplete. This both makes the return completion 24 value more accurate (matching iOS, if you cancel the share during the 25 recipient choice step, it will now fail), and avoids explicitly tearing 26 down the NSSharingServicePicker too early, which breaks the UI attaching mechanism. 27 1 28 2018-12-06 Wenson Hsieh <wenson_hsieh@apple.com> 2 29 -
trunk/Source/WebKit/UIProcess/Cocoa/WKShareSheet.mm
r237266 r238941 43 43 44 44 #if PLATFORM(MAC) 45 @interface WKShareSheet () <NSSharingService PickerDelegate>45 @interface WKShareSheet () <NSSharingServiceDelegate, NSSharingServicePickerDelegate> 46 46 @end 47 47 #endif … … 125 125 - (void)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker didChooseSharingService:(NSSharingService *)service 126 126 { 127 [self _didCompleteWithSuccess:!!service]; 127 if (service) 128 return; 129 130 [self _didCompleteWithSuccess:NO]; 128 131 [self dispatchDidDismiss]; 129 132 } 133 134 - (id <NSSharingServiceDelegate>)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker delegateForSharingService:(NSSharingService *)sharingService 135 { 136 return self; 137 } 138 139 - (NSWindow *)sharingService:(NSSharingService *)sharingService sourceWindowForShareItems:(NSArray *)items sharingContentScope:(NSSharingContentScope *)sharingContentScope 140 { 141 return [_webView window]; 142 } 143 144 - (void)sharingService:(NSSharingService *)sharingService didFailToShareItems:(NSArray *)items error:(NSError *)error 145 { 146 [self _didCompleteWithSuccess:NO]; 147 [self dispatchDidDismiss]; 148 } 149 150 - (void)sharingService:(NSSharingService *)sharingService didShareItems:(NSArray *)items 151 { 152 [self _didCompleteWithSuccess:YES]; 153 [self dispatchDidDismiss]; 154 } 155 130 156 #endif 131 157
Note: See TracChangeset
for help on using the changeset viewer.