Title: [238674] trunk/Source/WebKit
Revision
238674
Author
[email protected]
Date
2018-11-29 10:26:46 -0800 (Thu, 29 Nov 2018)

Log Message

Factor out configuration of the file upload image picker
https://bugs.webkit.org/show_bug.cgi?id=192138
<rdar://problem/46334871>

Reviewed by Tim Horton.

By factoring configuration of the picker into its own method, it makes it easier
to apply custom configuration in subclasses in the future.

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

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (238673 => 238674)


--- trunk/Source/WebKit/ChangeLog	2018-11-29 18:26:44 UTC (rev 238673)
+++ trunk/Source/WebKit/ChangeLog	2018-11-29 18:26:46 UTC (rev 238674)
@@ -1,3 +1,18 @@
+2018-11-29  Conrad Shultz  <[email protected]>
+
+        Factor out configuration of the file upload image picker
+        https://bugs.webkit.org/show_bug.cgi?id=192138
+        <rdar://problem/46334871>
+
+        Reviewed by Tim Horton.
+
+        By factoring configuration of the picker into its own method, it makes it easier
+        to apply custom configuration in subclasses in the future.
+
+        * UIProcess/ios/forms/WKFileUploadPanel.mm:
+        (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
+        (-[WKFileUploadPanel _configureImagePicker:]):
+
 2018-11-29  Tomas Popela  <[email protected]>
 
         [GTK][WPE] Fix BubblewrapLauncher clang warnings

Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm (238673 => 238674)


--- trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm	2018-11-29 18:26:44 UTC (rev 238673)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm	2018-11-29 18:26:46 UTC (rev 238674)
@@ -413,17 +413,11 @@
 - (void)_showPhotoPickerWithSourceType:(UIImagePickerControllerSourceType)sourceType
 {
     ASSERT([UIImagePickerController isSourceTypeAvailable:sourceType]);
-    
+
     _imagePicker = adoptNS([[UIImagePickerController alloc] init]);
-    [_imagePicker setDelegate:self];
+    [self _configureImagePicker:_imagePicker.get()];
     [_imagePicker setSourceType:sourceType];
-    [_imagePicker setAllowsEditing:NO];
-    [_imagePicker setModalPresentationStyle:UIModalPresentationFullScreen];
-    [_imagePicker _setAllowsMultipleSelection:_allowMultipleFiles];
     [_imagePicker setMediaTypes:[self _mediaTypesForPickerSourceType:sourceType]];
-
-    if (_mediaCaptureType != WebCore::MediaCaptureTypeNone)
-        [_imagePicker setCameraDevice:cameraDeviceForMediaCaptureType(_mediaCaptureType)];
     
     // Use a popover on the iPad if the source type is not the camera.
     // The camera will use a fullscreen, modal view controller.
@@ -434,6 +428,17 @@
         [self _presentFullscreenViewController:_imagePicker.get() animated:YES];
 }
 
+- (void)_configureImagePicker:(UIImagePickerController *)imagePicker
+{
+    [imagePicker setDelegate:self];
+    [imagePicker setAllowsEditing:NO];
+    [imagePicker setModalPresentationStyle:UIModalPresentationFullScreen];
+    [imagePicker _setAllowsMultipleSelection:_allowMultipleFiles];
+
+    if (_mediaCaptureType != WebCore::MediaCaptureTypeNone)
+        [imagePicker setCameraDevice:cameraDeviceForMediaCaptureType(_mediaCaptureType)];
+}
+
 #pragma mark - Presenting View Controllers
 
 - (void)_presentMenuOptionForCurrentInterfaceIdiom:(UIViewController *)viewController
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to