⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 238674 in webkit


Ignore:
Timestamp:
Nov 29, 2018, 10:26:46 AM (8 years ago)
Author:
Conrad Shultz
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:]):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r238663 r238674  
     12018-11-29  Conrad Shultz  <conrad_shultz@apple.com>
     2
     3        Factor out configuration of the file upload image picker
     4        https://bugs.webkit.org/show_bug.cgi?id=192138
     5        <rdar://problem/46334871>
     6
     7        Reviewed by Tim Horton.
     8
     9        By factoring configuration of the picker into its own method, it makes it easier
     10        to apply custom configuration in subclasses in the future.
     11
     12        * UIProcess/ios/forms/WKFileUploadPanel.mm:
     13        (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
     14        (-[WKFileUploadPanel _configureImagePicker:]):
     15
    1162018-11-29  Tomas Popela  <tpopela@redhat.com>
    217
  • trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm

    r237266 r238674  
    414414{
    415415    ASSERT([UIImagePickerController isSourceTypeAvailable:sourceType]);
    416    
     416
    417417    _imagePicker = adoptNS([[UIImagePickerController alloc] init]);
    418     [_imagePicker setDelegate:self];
     418    [self _configureImagePicker:_imagePicker.get()];
    419419    [_imagePicker setSourceType:sourceType];
    420     [_imagePicker setAllowsEditing:NO];
    421     [_imagePicker setModalPresentationStyle:UIModalPresentationFullScreen];
    422     [_imagePicker _setAllowsMultipleSelection:_allowMultipleFiles];
    423420    [_imagePicker setMediaTypes:[self _mediaTypesForPickerSourceType:sourceType]];
    424 
    425     if (_mediaCaptureType != WebCore::MediaCaptureTypeNone)
    426         [_imagePicker setCameraDevice:cameraDeviceForMediaCaptureType(_mediaCaptureType)];
    427421   
    428422    // Use a popover on the iPad if the source type is not the camera.
     
    433427    else
    434428        [self _presentFullscreenViewController:_imagePicker.get() animated:YES];
     429}
     430
     431- (void)_configureImagePicker:(UIImagePickerController *)imagePicker
     432{
     433    [imagePicker setDelegate:self];
     434    [imagePicker setAllowsEditing:NO];
     435    [imagePicker setModalPresentationStyle:UIModalPresentationFullScreen];
     436    [imagePicker _setAllowsMultipleSelection:_allowMultipleFiles];
     437
     438    if (_mediaCaptureType != WebCore::MediaCaptureTypeNone)
     439        [imagePicker setCameraDevice:cameraDeviceForMediaCaptureType(_mediaCaptureType)];
    435440}
    436441
Note: See TracChangeset for help on using the changeset viewer.