Title: [170952] trunk/Source/WebKit2
Revision
170952
Author
commit-qu...@webkit.org
Date
2014-07-09 21:38:13 -0700 (Wed, 09 Jul 2014)

Log Message

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

Patch by Joseph Pecoraro <pecor...@apple.com> on 2014-07-09
Reviewed by Sam Weinig.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _showMediaSourceSelectionSheet]):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (170951 => 170952)


--- trunk/Source/WebKit2/ChangeLog	2014-07-10 04:13:37 UTC (rev 170951)
+++ trunk/Source/WebKit2/ChangeLog	2014-07-10 04:38:13 UTC (rev 170952)
@@ -1,3 +1,13 @@
+2014-07-09  Joseph Pecoraro  <pecor...@apple.com>
+
+        [iOS] Use UIAlertController API in WKFileUploadPanel instead of SPI
+        https://bugs.webkit.org/show_bug.cgi?id=134777
+
+        Reviewed by Sam Weinig.
+
+        * UIProcess/ios/forms/WKFileUploadPanel.mm:
+        (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
+
 2014-07-09  Shivakumar JM  <shiva...@samsung.com>
 
         [EFL][WK2] Add new Public API in ewk_download_job.h to get size of the data already downloaded.

Modified: trunk/Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm (170951 => 170952)


--- trunk/Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm	2014-07-10 04:13:37 UTC (rev 170951)
+++ trunk/Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm	2014-07-10 04:38:13 UTC (rev 170952)
@@ -41,7 +41,6 @@
 #import <AVFoundation/AVFoundation.h>
 #import <CoreMedia/CoreMedia.h>
 #import <MobileCoreServices/MobileCoreServices.h>
-#import <UIKit/UIAlertController_Private.h>
 #import <UIKit/UIApplication_Private.h>
 #import <UIKit/UIImagePickerController_Private.h>
 #import <UIKit/UIImage_Private.h>
@@ -388,24 +387,27 @@
     else
         cameraString = WEB_UI_STRING_KEY("Take Photo", "Take Photo (file upload action sheet)", "File Upload alert sheet camera button string for taking only photos");
 
-    _actionSheetController = [UIAlertController _alertControllerWithTitle:nil message:nil];
-    [_actionSheetController setPreferredStyle:UIAlertControllerStyleActionSheet];
+    _actionSheetController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
 
-    [_actionSheetController _addActionWithTitle:cancelString style:UIAlertActionStyleCancel handler:^{
+    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:cancelString style:UIAlertActionStyleCancel handler:^(UIAlertAction *){
         [self _cancel];
         // We handled cancel ourselves. Prevent the popover controller delegate from cancelling when the popover dismissed.
         [_presentationPopover setDelegate:nil];
     }];
 
-    [_actionSheetController _addActionWithTitle:cameraString style:UIAlertActionStyleDefault handler:^{
+    UIAlertAction *cameraAction = [UIAlertAction actionWithTitle:cameraString style:UIAlertActionStyleDefault handler:^(UIAlertAction *){
         _usingCamera = YES;
         [self _showPhotoPickerWithSourceType:UIImagePickerControllerSourceTypeCamera];
     }];
 
-    [_actionSheetController _addActionWithTitle:existingString style:UIAlertActionStyleDefault handler:^{
+    UIAlertAction *photoLibraryAction = [UIAlertAction actionWithTitle:existingString style:UIAlertActionStyleDefault handler:^(UIAlertAction *){
         [self _showPhotoPickerWithSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
     }];
 
+    [_actionSheetController addAction:cancelAction];
+    [_actionSheetController addAction:cameraAction];
+    [_actionSheetController addAction:photoLibraryAction];
+
     if (UICurrentUserInterfaceIdiomIsPad())
         [self _presentPopoverWithContentViewController:_actionSheetController.get() animated:YES];
     else
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to