Title: [235512] trunk/Source/WebKit
Revision
235512
Author
[email protected]
Date
2018-08-30 11:29:58 -0700 (Thu, 30 Aug 2018)

Log Message

Web Share API compatible with AppleTV and WatchOS
https://bugs.webkit.org/show_bug.cgi?id=189157

Patch by Olivia Barnett <[email protected]> on 2018-08-30
Reviewed by Tim Horton.

* Shared/WebPreferencesDefaultValues.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView fileUploadPanelDidDismiss:]):
* UIProcess/ios/forms/WKShareSheet.h:
* UIProcess/ios/forms/WKShareSheet.mm:
(-[WKShareSheet invokeShareSheetWithResolution:]):
Added platform checks.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (235511 => 235512)


--- trunk/Source/WebKit/ChangeLog	2018-08-30 18:21:45 UTC (rev 235511)
+++ trunk/Source/WebKit/ChangeLog	2018-08-30 18:29:58 UTC (rev 235512)
@@ -1,3 +1,19 @@
+2018-08-30  Olivia Barnett  <[email protected]>
+
+        Web Share API compatible with AppleTV and WatchOS
+        https://bugs.webkit.org/show_bug.cgi?id=189157
+
+        Reviewed by Tim Horton.
+
+        * Shared/WebPreferencesDefaultValues.h:
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView fileUploadPanelDidDismiss:]):
+        * UIProcess/ios/forms/WKShareSheet.h:
+        * UIProcess/ios/forms/WKShareSheet.mm:
+        (-[WKShareSheet invokeShareSheetWithResolution:]):
+        Added platform checks.
+
 2018-08-30  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r235413 and r235444.

Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h (235511 => 235512)


--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2018-08-30 18:21:45 UTC (rev 235511)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2018-08-30 18:29:58 UTC (rev 235512)
@@ -65,7 +65,6 @@
 #define DEFAULT_TEXT_AREAS_ARE_RESIZABLE false
 #define DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY false
 #define DEFAULT_SHOULD_RESPECT_IMAGE_ORIENTATION true
-#define DEFAULT_WEB_SHARE_ENABLED true
 #define DEFAULT_PASSWORD_ECHO_ENABLED true
 #define DEFAULT_ALLOWS_INLINE_MEDIA_PLAYBACK false
 #define DEFAULT_ALLOWS_INLINE_MEDIA_PLAYBACK_AFTER_FULLSCREEN true
@@ -174,6 +173,12 @@
 
 #endif
 
+#if PLATFORM(IOS) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
+#define DEFAULT_WEB_SHARE_ENABLED true
+#else
+#define DEFAULT_WEB_SHARE_ENABLED false
+#endif
+
 #if !PLATFORM(WATCHOS)
 #define DEFAULT_AVFOUNDATION_ENABLED true
 #else

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (235511 => 235512)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2018-08-30 18:21:45 UTC (rev 235511)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2018-08-30 18:29:58 UTC (rev 235512)
@@ -27,6 +27,10 @@
 
 #import "WKContentView.h"
 
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
+#import "WKShareSheet.h"
+#endif
+
 #import "AssistedNodeInformation.h"
 #import "DragDropInteractionState.h"
 #import "EditorState.h"
@@ -176,7 +180,9 @@
 #endif
     RetainPtr<WKFormInputSession> _formInputSession;
     RetainPtr<WKFileUploadPanel> _fileUploadPanel;
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     RetainPtr<WKShareSheet> _shareSheet;
+#endif
     RetainPtr<UIGestureRecognizer> _previewGestureRecognizer;
     RetainPtr<UIGestureRecognizer> _previewSecondaryGestureRecognizer;
     Vector<bool> _focusStateStack;
@@ -265,7 +271,11 @@
 
 @end
 
-@interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UITextAutoscrolling, UITextInputMultiDocument, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWebTouchEventsGestureRecognizerDelegate, UIWKInteractionViewProtocol, WKActionSheetAssistantDelegate, WKFileUploadPanelDelegate, WKShareSheetDelegate, WKKeyboardScrollable
+@interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UITextAutoscrolling, UITextInputMultiDocument, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWebTouchEventsGestureRecognizerDelegate, UIWKInteractionViewProtocol, WKActionSheetAssistantDelegate, WKFileUploadPanelDelegate
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
+    , WKShareSheetDelegate
+#endif
+    , WKKeyboardScrollable
 #if ENABLE(DATA_INTERACTION)
     , UIDragInteractionDelegate, UIDropInteractionDelegate
 #endif

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (235511 => 235512)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-08-30 18:21:45 UTC (rev 235511)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-08-30 18:29:58 UTC (rev 235512)
@@ -4700,6 +4700,15 @@
     [_fileUploadPanel presentWithParameters:parameters resultListener:listener];
 }
 
+- (void)fileUploadPanelDidDismiss:(WKFileUploadPanel *)fileUploadPanel
+{
+    ASSERT(_fileUploadPanel.get() == fileUploadPanel);
+    
+    [_fileUploadPanel setDelegate:nil];
+    _fileUploadPanel = nil;
+}
+
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
 - (void)_showShareSheet:(const ShareDataWithParsedURL&)data completionHandler:(CompletionHandler<void(bool)>&&)completionHandler
 {
     ASSERT(!_shareSheet);
@@ -4712,14 +4721,6 @@
     [_shareSheet presentWithParameters:data completionHandler:WTFMove(completionHandler)];
 }
 
-- (void)fileUploadPanelDidDismiss:(WKFileUploadPanel *)fileUploadPanel
-{
-    ASSERT(_fileUploadPanel.get() == fileUploadPanel);
-
-    [_fileUploadPanel setDelegate:nil];
-    _fileUploadPanel = nil;
-}
-
 - (void)shareSheetDidDismiss:(WKShareSheet *)shareSheet
 {
     ASSERT(_shareSheet == shareSheet);
@@ -4727,6 +4728,7 @@
     [_shareSheet setDelegate:nil];
     _shareSheet = nil;
 }
+#endif
 
 #pragma mark - UITextInputMultiDocument
 

Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKShareSheet.h (235511 => 235512)


--- trunk/Source/WebKit/UIProcess/ios/forms/WKShareSheet.h	2018-08-30 18:21:45 UTC (rev 235511)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKShareSheet.h	2018-08-30 18:29:58 UTC (rev 235512)
@@ -23,7 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
 
 #import <UIKit/UIKit.h>
 #import <WebCore/ShareData.h>
@@ -51,4 +51,4 @@
 - (void)shareSheetDidDismiss:(WKShareSheet *)shareSheet;
 @end
 
-#endif // PLATFORM(IOS)
+#endif // PLATFORM(IOS) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)

Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKShareSheet.mm (235511 => 235512)


--- trunk/Source/WebKit/UIProcess/ios/forms/WKShareSheet.mm	2018-08-30 18:21:45 UTC (rev 235511)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKShareSheet.mm	2018-08-30 18:29:58 UTC (rev 235512)
@@ -26,8 +26,7 @@
 #import "config.h"
 #import "WKShareSheet.h"
 
-#if PLATFORM(IOS)
-
+#if PLATFORM(IOS) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
 #import "UIKitSPI.h"
 #import "WKContentViewInteraction.h"
 #import "WebPageProxy.h"
@@ -127,4 +126,4 @@
 }
 
 @end
-#endif // PLATFORM(IOS)
+#endif // PLATFORM(IOS) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to