Changeset 170952 in webkit


Ignore:
Timestamp:
Jul 9, 2014, 9:38:13 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[iOS] Use UIAlertController API in WKFileUploadPanel instead of SPI
https://bugs.webkit.org/show_bug.cgi?id=134777

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2014-07-09
Reviewed by Sam Weinig.

  • UIProcess/ios/forms/WKFileUploadPanel.mm:

(-[WKFileUploadPanel _showMediaSourceSelectionSheet]):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r170951 r170952  
     12014-07-09  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        [iOS] Use UIAlertController API in WKFileUploadPanel instead of SPI
     4        https://bugs.webkit.org/show_bug.cgi?id=134777
     5
     6        Reviewed by Sam Weinig.
     7
     8        * UIProcess/ios/forms/WKFileUploadPanel.mm:
     9        (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
     10
    1112014-07-09  Shivakumar JM  <shiva.jm@samsung.com>
    212
  • trunk/Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm

    r170774 r170952  
    4242#import <CoreMedia/CoreMedia.h>
    4343#import <MobileCoreServices/MobileCoreServices.h>
    44 #import <UIKit/UIAlertController_Private.h>
    4544#import <UIKit/UIApplication_Private.h>
    4645#import <UIKit/UIImagePickerController_Private.h>
     
    389388        cameraString = WEB_UI_STRING_KEY("Take Photo", "Take Photo (file upload action sheet)", "File Upload alert sheet camera button string for taking only photos");
    390389
    391     _actionSheetController = [UIAlertController _alertControllerWithTitle:nil message:nil];
    392     [_actionSheetController setPreferredStyle:UIAlertControllerStyleActionSheet];
    393 
    394     [_actionSheetController _addActionWithTitle:cancelString style:UIAlertActionStyleCancel handler:^{
     390    _actionSheetController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
     391
     392    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:cancelString style:UIAlertActionStyleCancel handler:^(UIAlertAction *){
    395393        [self _cancel];
    396394        // We handled cancel ourselves. Prevent the popover controller delegate from cancelling when the popover dismissed.
     
    398396    }];
    399397
    400     [_actionSheetController _addActionWithTitle:cameraString style:UIAlertActionStyleDefault handler:^{
     398    UIAlertAction *cameraAction = [UIAlertAction actionWithTitle:cameraString style:UIAlertActionStyleDefault handler:^(UIAlertAction *){
    401399        _usingCamera = YES;
    402400        [self _showPhotoPickerWithSourceType:UIImagePickerControllerSourceTypeCamera];
    403401    }];
    404402
    405     [_actionSheetController _addActionWithTitle:existingString style:UIAlertActionStyleDefault handler:^{
     403    UIAlertAction *photoLibraryAction = [UIAlertAction actionWithTitle:existingString style:UIAlertActionStyleDefault handler:^(UIAlertAction *){
    406404        [self _showPhotoPickerWithSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
    407405    }];
     406
     407    [_actionSheetController addAction:cancelAction];
     408    [_actionSheetController addAction:cameraAction];
     409    [_actionSheetController addAction:photoLibraryAction];
    408410
    409411    if (UICurrentUserInterfaceIdiomIsPad())
Note: See TracChangeset for help on using the changeset viewer.