Changeset 189877 in webkit


Ignore:
Timestamp:
Sep 16, 2015 12:52:17 PM (9 years ago)
Author:
mitz@apple.com
Message:

[iOS] Inline implementation of -[WKImagePreviewViewController previewActions]
https://bugs.webkit.org/show_bug.cgi?id=149224

Reviewed by Tim Horton.

  • Platform/spi/ios/UIKitSPI.h: Declare UIViewControllerPreviewAction and its factory method.
  • UIProcess/WKImagePreviewViewController.mm:

(-[WKImagePreviewViewController previewActions]): Moved here.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r189871 r189877  
     12015-09-16  Dan Bernstein  <mitz@apple.com>
     2
     3        [iOS] Inline implementation of -[WKImagePreviewViewController previewActions]
     4        https://bugs.webkit.org/show_bug.cgi?id=149224
     5
     6        Reviewed by Tim Horton.
     7
     8        * Platform/spi/ios/UIKitSPI.h: Declare UIViewControllerPreviewAction and its factory method.
     9        * UIProcess/WKImagePreviewViewController.mm:
     10        (-[WKImagePreviewViewController previewActions]): Moved here.
     11
    1122015-09-16  Alexey Proskuryakov  <ap@apple.com>
    213
  • trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h

    r189748 r189877  
    758758@end
    759759
     760@interface UIViewControllerPreviewAction : NSObject <NSCopying>
     761@end
     762
     763@interface UIViewControllerPreviewAction ()
     764+ (instancetype)actionWithTitle:(NSString *)title handler:(void (^)(UIViewControllerPreviewAction *action, UIViewController *previewViewController))handler;
     765@end
     766
    760767#endif // USE(APPLE_INTERNAL_SDK)
    761768
  • trunk/Source/WebKit2/UIProcess/WKImagePreviewViewController.mm

    r189674 r189877  
    9292}
    9393
    94 #if USE(APPLE_INTERNAL_SDK)
    95 #import <WebKitAdditions/WKImagePreviewViewController.mm>
     94#if HAVE(LINK_PREVIEW)
     95- (NSArray <UIViewControllerPreviewAction *> *)previewActions
     96{
     97    NSMutableArray<UIViewControllerPreviewAction *> *previewActions = [NSMutableArray array];
     98    for (_WKElementAction *imageAction in _imageActions.get()) {
     99        UIViewControllerPreviewAction *previewAction = [UIViewControllerPreviewAction actionWithTitle:imageAction.title handler:^(UIViewControllerPreviewAction *action, UIViewController *previewViewController) {
     100            if ([imageAction respondsToSelector:@selector(runActionWithElementInfo:)])
     101                [imageAction runActionWithElementInfo:_activatedElementInfo.get()];
     102        }];
     103
     104        [previewActions addObject:previewAction];
     105    }
     106
     107    return previewActions;
     108}
    96109#endif
    97110
Note: See TracChangeset for help on using the changeset viewer.