Title: [199823] trunk/Source/WebKit2
Revision
199823
Author
commit-qu...@webkit.org
Date
2016-04-21 11:10:34 -0700 (Thu, 21 Apr 2016)

Log Message

[iOS] Allow clients to hide the accessory view on a form input session
https://bugs.webkit.org/show_bug.cgi?id=155574

Patch by Chelsea Pugh <cp...@apple.com> on 2016-04-21
Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/_WKFormInputSession.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFormInputSession accessoryViewShouldNotShow]): Getter for accessoryViewShouldNotShow.
(-[WKFormInputSession setAccessoryViewShouldNotShow:]): Set accessoryViewShouldNotShow and reload input views.
(-[WKContentView requiresAccessoryView]): If the accessory view should be not be shown, do not require
the accessory view.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (199822 => 199823)


--- trunk/Source/WebKit2/ChangeLog	2016-04-21 18:03:38 UTC (rev 199822)
+++ trunk/Source/WebKit2/ChangeLog	2016-04-21 18:10:34 UTC (rev 199823)
@@ -1,3 +1,17 @@
+2016-04-21  Chelsea Pugh  <cp...@apple.com>
+
+        [iOS] Allow clients to hide the accessory view on a form input session
+        https://bugs.webkit.org/show_bug.cgi?id=155574
+
+        Reviewed by Dan Bernstein.
+
+        * UIProcess/API/Cocoa/_WKFormInputSession.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKFormInputSession accessoryViewShouldNotShow]): Getter for accessoryViewShouldNotShow.
+        (-[WKFormInputSession setAccessoryViewShouldNotShow:]): Set accessoryViewShouldNotShow and reload input views.
+        (-[WKContentView requiresAccessoryView]): If the accessory view should be not be shown, do not require
+        the accessory view.
+
 2016-04-21  Chris Dumez  <cdu...@apple.com>
 
         Drop [UsePointersEvenForNonNullableObjectArguments] from Range

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKFormInputSession.h (199822 => 199823)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKFormInputSession.h	2016-04-21 18:03:38 UTC (rev 199822)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKFormInputSession.h	2016-04-21 18:10:34 UTC (rev 199823)
@@ -42,6 +42,7 @@
 @property (nonatomic, copy) NSString *accessoryViewCustomButtonTitle;
 @property (nonatomic, strong) UIView *customInputView WK_AVAILABLE(NA, WK_IOS_TBA);
 @property (nonatomic, copy) NSArray<UITextSuggestion *> *suggestions WK_AVAILABLE(NA, WK_IOS_TBA);
+@property (nonatomic) BOOL accessoryViewShouldNotShow WK_AVAILABLE(NA, WK_IOS_TBA);
 #endif
 
 @end

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (199822 => 199823)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2016-04-21 18:03:38 UTC (rev 199822)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2016-04-21 18:10:34 UTC (rev 199823)
@@ -263,6 +263,7 @@
     RetainPtr<WKFocusedElementInfo> _focusedElementInfo;
     RetainPtr<UIView> _customInputView;
     RetainPtr<NSArray<UITextSuggestion *>> _suggestions;
+    BOOL _accessoryViewShouldNotShow;
 }
 
 - (instancetype)initWithContentView:(WKContentView *)view focusedElementInfo:(WKFocusedElementInfo *)elementInfo userObject:(NSObject <NSSecureCoding> *)userObject
@@ -307,6 +308,20 @@
         [_contentView reloadInputViews];
 }
 
+- (BOOL)accessoryViewShouldNotShow
+{
+    return _accessoryViewShouldNotShow;
+}
+
+- (void)setAccessoryViewShouldNotShow:(BOOL)accessoryViewShouldNotShow
+{
+    if (_accessoryViewShouldNotShow == accessoryViewShouldNotShow)
+        return;
+
+    _accessoryViewShouldNotShow = accessoryViewShouldNotShow;
+    [_contentView reloadInputViews];
+}
+
 - (UIView *)customInputView
 {
     return _customInputView.get();
@@ -1550,6 +1565,9 @@
 
 - (BOOL)requiresAccessoryView
 {
+    if ([_formInputSession accessoryViewShouldNotShow])
+        return NO;
+
     switch (_assistedNodeInformation.elementType) {
     case InputType::None:
         return NO;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to