Title: [236491] trunk/Source/WebKit
Revision
236491
Author
[email protected]
Date
2018-09-25 18:18:53 -0700 (Tue, 25 Sep 2018)

Log Message

Enable customization of the file upload panel
https://bugs.webkit.org/show_bug.cgi?id=189970

Reviewed by Wenson Hsieh.

With this change, platform implementations can override, or implement in a category,
+[WKContentView _fileUploadPanelClass] as needed.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showRunOpenPanel:resultListener:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (236490 => 236491)


--- trunk/Source/WebKit/ChangeLog	2018-09-26 00:24:52 UTC (rev 236490)
+++ trunk/Source/WebKit/ChangeLog	2018-09-26 01:18:53 UTC (rev 236491)
@@ -1,3 +1,17 @@
+2018-09-25  Conrad Shultz  <[email protected]>
+
+        Enable customization of the file upload panel
+        https://bugs.webkit.org/show_bug.cgi?id=189970
+
+        Reviewed by Wenson Hsieh.
+
+        With this change, platform implementations can override, or implement in a category,
+        +[WKContentView _fileUploadPanelClass] as needed.
+
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _showRunOpenPanel:resultListener:]):
+
 2018-09-25  Chris Dumez  <[email protected]>
 
         Unreviewed, rolling out r236420 and r236458.

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (236490 => 236491)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2018-09-26 00:24:52 UTC (rev 236490)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2018-09-26 01:18:53 UTC (rev 236491)
@@ -404,4 +404,8 @@
 @end
 #endif
 
+@interface WKContentView (WKFileUploadPanel)
++ (Class)_fileUploadPanelClass;
+@end
+
 #endif // PLATFORM(IOS)

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (236490 => 236491)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-09-26 00:24:52 UTC (rev 236490)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-09-26 01:18:53 UTC (rev 236491)
@@ -117,6 +117,10 @@
 #import "WKFormColorControl.h"
 #endif
 
+#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKPlatformFileUploadPanel.mm>)
+#import <WebKitAdditions/WKPlatformFileUploadPanel.mm>
+#endif
+
 @interface UIEvent(UIEventInternal)
 @property (nonatomic, assign) UIKeyboardInputFlags _inputFlags;
 @end
@@ -4731,7 +4735,14 @@
     if (_fileUploadPanel)
         return;
 
-    _fileUploadPanel = adoptNS([[WKFileUploadPanel alloc] initWithView:self]);
+    Class ownClass = self.class;
+    Class panelClass = nil;
+    if ([ownClass respondsToSelector:@selector(_fileUploadPanelClass)])
+        panelClass = [ownClass _fileUploadPanelClass];
+    if (!panelClass)
+        panelClass = [WKFileUploadPanel class];
+
+    _fileUploadPanel = adoptNS([[panelClass alloc] initWithView:self]);
     [_fileUploadPanel setDelegate:self];
     [_fileUploadPanel presentWithParameters:parameters resultListener:listener];
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to