Changeset 195971 in webkit


Ignore:
Timestamp:
Feb 1, 2016, 12:23:41 PM (10 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/20150072> [iOS] Remove some file upload code only needed before iOS 9
https://bugs.webkit.org/show_bug.cgi?id=153754

Reviewed by Darin Adler.

Source/WebCore:

  • English.lproj/Localizable.strings: Updated for removal of WebKit2 string.

Source/WebKit2:

  • Platform/spi/ios/UIKitSPI.h: Removed conditional forward declaration of SPI.
  • UIProcess/ios/forms/WKFileUploadPanel.mm:

(photoLibraryIcon): Removed check for HAVE_WEBKIT_DOC_PICKER_ICONS, which is always true in

iOS 9 and later.

(cameraIcon): Ditto.
(-[WKFileUploadPanel presentWithParameters:resultListener:]): Removed branch for when

UIDocumentMenuViewController doesn’t respond to
-_initIgnoringApplicationEntitlementForImportOfTypes:.

(-[WKFileUploadPanel _showMediaSourceSelectionSheet]): Deleted now-unused method.

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r195970 r195971  
     12016-02-01  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/20150072> [iOS] Remove some file upload code only needed before iOS 9
     4        https://bugs.webkit.org/show_bug.cgi?id=153754
     5
     6        Reviewed by Darin Adler.
     7
     8        * English.lproj/Localizable.strings: Updated for removal of WebKit2 string.
     9
    1102016-02-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
    211
  • trunk/Source/WebCore/English.lproj/Localizable.strings

    r192745 r195971  
    125125"Call Using iPhone:" = "Call Using iPhone:";
    126126
    127 /* File Upload alert sheet button string to cancel */
    128 "Cancel (file upload action sheet)" = "Cancel";
    129 
    130127/* Title for Cancel button label in button bar */
    131128"Cancel button label in button bar" = "Cancel";
  • trunk/Source/WebKit2/ChangeLog

    r195964 r195971  
     12016-02-01  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/20150072> [iOS] Remove some file upload code only needed before iOS 9
     4        https://bugs.webkit.org/show_bug.cgi?id=153754
     5
     6        Reviewed by Darin Adler.
     7
     8        * Platform/spi/ios/UIKitSPI.h: Removed conditional forward declaration of SPI.
     9
     10        * UIProcess/ios/forms/WKFileUploadPanel.mm:
     11        (photoLibraryIcon): Removed check for HAVE_WEBKIT_DOC_PICKER_ICONS, which is always true in
     12          iOS 9 and later.
     13        (cameraIcon): Ditto.
     14        (-[WKFileUploadPanel presentWithParameters:resultListener:]): Removed branch for when
     15          UIDocumentMenuViewController doesn’t respond to
     16          -_initIgnoringApplicationEntitlementForImportOfTypes:.
     17        (-[WKFileUploadPanel _showMediaSourceSelectionSheet]): Deleted now-unused method.
     18
    1192016-02-01  Anders Carlsson  <andersca@apple.com>
    220
  • trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h

    r195840 r195971  
    8080#endif
    8181
    82 // FIXME: Unconditionally include this file when a new SDK is available. <rdar://problem/20150072>
    83 #if defined(__has_include) && __has_include(<UIKit/UIDocumentMenuViewController_Private.h>)
    84 #import <UIKit/UIDocumentMenuViewController_Private.h>
    85 #else
    86 @interface UIDocumentMenuViewController ()
    87 - (instancetype)_initIgnoringApplicationEntitlementForImportOfTypes:(NSArray *)types;
    88 @end
    89 #endif
    90 
    9182#else
    9283
  • trunk/Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm

    r195171 r195971  
    7474static inline UIImage *photoLibraryIcon()
    7575{
    76     // FIXME: Remove when a new SDK is available. <rdar://problem/20150072>
    77 #if defined(HAVE_WEBKIT_DOC_PICKER_ICONS)
    7876    return _UIImageGetWebKitPhotoLibraryIcon();
    79 #else
    80     return nil;
    81 #endif
    8277}
    8378
    8479static inline UIImage *cameraIcon()
    8580{
    86     // FIXME: Remove when a new SDK is available. <rdar://problem/20150072>
    87 #if defined(HAVE_WEBKIT_DOC_PICKER_ICONS)
    8881    return _UIImageGetWebKitTakePhotoOrVideoIcon();
    89 #else
    90     return nil;
    91 #endif
    9282}
    9383
     
    375365    _mimeTypes = adoptNS([mimeTypes copy]);
    376366
    377     // FIXME: Remove this check and the fallback code when a new SDK is available. <rdar://problem/20150072>
    378     if ([UIDocumentMenuViewController instancesRespondToSelector:@selector(_initIgnoringApplicationEntitlementForImportOfTypes:)]) {
    379         [self _showDocumentPickerMenu];
    380         return;
    381     }
    382 
    383     // Fall back to showing the old-style source selection sheet.
    384     // If there is no camera or this is type=multiple, just show the image picker for the photo library.
    385     // Otherwise, show an action sheet for the user to choose between camera or library.
    386     if (_allowMultipleFiles || ![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
    387         [self _showPhotoPickerWithSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
    388     else
    389         [self _showMediaSourceSelectionSheet];
     367    [self _showDocumentPickerMenu];
    390368}
    391369
     
    481459
    482460    return WEB_UI_STRING_KEY("Take Photo", "Take Photo (file upload action sheet)", "File Upload alert sheet camera button string for taking only photos");
    483 }
    484 
    485 - (void)_showMediaSourceSelectionSheet
    486 {
    487     NSString *existingString = [self _photoLibraryButtonLabel];
    488     NSString *cameraString = [self _cameraButtonLabel];
    489     NSString *cancelString = WEB_UI_STRING_KEY("Cancel", "Cancel (file upload action sheet)", "File Upload alert sheet button string to cancel");
    490 
    491     _actionSheetController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
    492 
    493     UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:cancelString style:UIAlertActionStyleCancel handler:^(UIAlertAction *){
    494         [self _cancel];
    495         // We handled cancel ourselves. Prevent the popover controller delegate from cancelling when the popover dismissed.
    496         [_presentationPopover setDelegate:nil];
    497     }];
    498 
    499     UIAlertAction *cameraAction = [UIAlertAction actionWithTitle:cameraString style:UIAlertActionStyleDefault handler:^(UIAlertAction *){
    500         _usingCamera = YES;
    501         [self _showPhotoPickerWithSourceType:UIImagePickerControllerSourceTypeCamera];
    502     }];
    503 
    504     UIAlertAction *photoLibraryAction = [UIAlertAction actionWithTitle:existingString style:UIAlertActionStyleDefault handler:^(UIAlertAction *){
    505         [self _showPhotoPickerWithSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
    506     }];
    507 
    508     [_actionSheetController addAction:cancelAction];
    509     [_actionSheetController addAction:cameraAction];
    510     [_actionSheetController addAction:photoLibraryAction];
    511 
    512     [self _presentForCurrentInterfaceIdiom:_actionSheetController.get()];
    513461}
    514462
Note: See TracChangeset for help on using the changeset viewer.