Changeset 191805 in webkit
- Timestamp:
- Oct 30, 2015 12:38:40 PM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r191804 r191805 1 2015-10-30 Beth Dakin <bdakin@apple.com> 2 3 Tapping and holding a link should have a share option 4 https://bugs.webkit.org/show_bug.cgi?id=150693 5 -and corresponding- 6 rdar://problem/21319702 7 8 Reviewed by Tim Horton. 9 10 * English.lproj/Localizable.strings: 11 1 12 2015-10-30 Joseph Pecoraro <pecoraro@apple.com> 2 13 -
trunk/Source/WebCore/English.lproj/Localizable.strings
r190611 r191805 497 497 "Set Writing Direction (Undo action name)" = "Set Writing Direction"; 498 498 499 /* Title for Share action button */ 500 "Share…" = "Share…"; 501 499 502 /* Show colors context menu item */ 500 503 "Show Colors" = "Show Colors"; -
trunk/Source/WebKit2/ChangeLog
r191802 r191805 1 2015-10-30 Beth Dakin <bdakin@apple.com> 2 3 Tapping and holding a link should have a share option 4 https://bugs.webkit.org/show_bug.cgi?id=150693 5 -and corresponding- 6 rdar://problem/21319702 7 8 Reviewed by Tim Horton. 9 10 New _WKElementActionType called _WKElementActionTypeShare. 11 * UIProcess/API/Cocoa/_WKElementAction.h: 12 * UIProcess/API/Cocoa/_WKElementAction.mm: 13 (+[_WKElementAction _elementActionWithType:customTitle:assistant:]): 14 15 _WKElementActionTypeShare is part of the default actions for links. 16 * UIProcess/ios/WKActionSheetAssistant.h: 17 * UIProcess/ios/WKActionSheetAssistant.mm: 18 (-[WKActionSheetAssistant defaultActionsForLinkSheet:]): 19 20 Handle the sharing part! 21 * UIProcess/ios/WKContentViewInteraction.mm: 22 (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]): 23 24 To support this in PDF, PDF need to create a _webSelectionAssistant. 25 * UIProcess/ios/WKPDFView.mm: 26 (-[WKPDFView web_initWithFrame:webView:]): 27 (-[WKPDFView actionSheetAssistant:openElementAtLocation:]): 28 (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]): 29 (-[WKPDFView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]): 30 1 31 2015-10-30 Tim Horton <timothy_horton@apple.com> 2 32 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKElementAction.h
r189547 r191805 44 44 _WKElementActionTypeOpenInDefaultBrowser WK_ENUM_AVAILABLE(NA, 9_0), 45 45 _WKElementActionTypeOpenInExternalApplication WK_ENUM_AVAILABLE(NA, 9_0), 46 _WKElementActionTypeShare WK_ENUM_AVAILABLE(NA, WK_IOS_TBA), 46 47 #endif 47 48 } WK_ENUM_AVAILABLE(10_10, 8_0); -
trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKElementAction.mm
r186718 r191805 128 128 break; 129 129 #endif 130 case _WKElementActionTypeShare: 131 title = WEB_UI_STRING("Share…", "Title for Share action button"); 132 handler = ^(WKActionSheetAssistant *assistant, _WKActivatedElementInfo *actionInfo) { 133 [assistant.delegate actionSheetAssistant:assistant shareElementWithURL:actionInfo.URL rect:actionInfo.boundingRect]; 134 }; 135 break; 130 136 default: 131 137 [NSException raise:NSInvalidArgumentException format:@"There is no standard web element action of type %ld.", (long)type]; -
trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.h
r188349 r191805 46 46 - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant performAction:(WebKit::SheetAction)action; 47 47 - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant openElementAtLocation:(CGPoint)location; 48 - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant shareElementWithURL:(NSURL *)url rect:(CGRect)boundingRect; 48 49 #if HAVE(APP_LINKS) 49 50 - (BOOL)actionSheetAssistant:(WKActionSheetAssistant *)assistant shouldIncludeAppLinkActionsForElement:(_WKActivatedElementInfo *)element; -
trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm
r188349 r191805 344 344 [defaultActions addObject:[_WKElementAction _elementActionWithType:_WKElementActionTypeAddToReadingList assistant:self]]; 345 345 #endif 346 if (![[targetURL scheme] length] || [[targetURL scheme] caseInsensitiveCompare:@"javascript"] != NSOrderedSame) 346 if (![[targetURL scheme] length] || [[targetURL scheme] caseInsensitiveCompare:@"javascript"] != NSOrderedSame) { 347 347 [defaultActions addObject:[_WKElementAction _elementActionWithType:_WKElementActionTypeCopy assistant:self]]; 348 [defaultActions addObject:[_WKElementAction _elementActionWithType:_WKElementActionTypeShare assistant:self]]; 349 } 348 350 349 351 return defaultActions; -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r191644 r191805 3371 3371 } 3372 3372 3373 - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant shareElementWithURL:(NSURL *)url rect:(CGRect)boundingRect 3374 { 3375 if (_textSelectionAssistant) 3376 [_textSelectionAssistant showShareSheetFor:url.absoluteString fromRect:boundingRect]; 3377 else if (_webSelectionAssistant) 3378 [_webSelectionAssistant showShareSheetFor:url.absoluteString fromRect:boundingRect]; 3379 } 3380 3373 3381 #if HAVE(APP_LINKS) 3374 3382 - (BOOL)actionSheetAssistant:(WKActionSheetAssistant *)assistant shouldIncludeAppLinkActionsForElement:(_WKActivatedElementInfo *)element -
trunk/Source/WebKit2/UIProcess/ios/WKPDFView.mm
r186719 r191805 106 106 107 107 dispatch_queue_t _findQueue; 108 109 RetainPtr<UIWKSelectionAssistant> _webSelectionAssistant; 108 110 } 109 111 … … 719 721 } 720 722 723 - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant shareElementWithURL:(NSURL *)url rect:(CGRect)boundingRect 724 { 725 _webSelectionAssistant = adoptNS([[UIWKSelectionAssistant alloc] initWithView:self]); 726 [_webSelectionAssistant showShareSheetFor:url.absoluteString fromRect:boundingRect]; 727 _webSelectionAssistant = nil; 728 } 729 721 730 #if HAVE(APP_LINKS) 722 731 - (BOOL)actionSheetAssistant:(WKActionSheetAssistant *)assistant shouldIncludeAppLinkActionsForElement:(_WKActivatedElementInfo *)element
Note: See TracChangeset
for help on using the changeset viewer.