Title: [191534] trunk/Source/WebKit2
- Revision
- 191534
- Author
- [email protected]
- Date
- 2015-10-24 08:54:09 -0700 (Sat, 24 Oct 2015)
Log Message
[iOS] Allow clients to specify a custom input view to be used for a form input session
https://bugs.webkit.org/show_bug.cgi?id=150395
Reviewed by Tim Horton.
* UIProcess/API/Cocoa/_WKFormInputSession.h: Added customInputView property to the protocol.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFormInputSession customInputView]): Added this getter.
(-[WKFormInputSession setCustomInputView:]): Added this setter, which reloads the input
views when the custom input view changes.
(-[WKContentView inputView]): Changed to return the custom view from the input session if
there is one.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (191533 => 191534)
--- trunk/Source/WebKit2/ChangeLog 2015-10-24 05:53:44 UTC (rev 191533)
+++ trunk/Source/WebKit2/ChangeLog 2015-10-24 15:54:09 UTC (rev 191534)
@@ -1,3 +1,19 @@
+2015-10-24 Dan Bernstein <[email protected]>
+
+ [iOS] Allow clients to specify a custom input view to be used for a form input session
+ https://bugs.webkit.org/show_bug.cgi?id=150395
+
+ Reviewed by Tim Horton.
+
+ * UIProcess/API/Cocoa/_WKFormInputSession.h: Added customInputView property to the protocol.
+
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKFormInputSession customInputView]): Added this getter.
+ (-[WKFormInputSession setCustomInputView:]): Added this setter, which reloads the input
+ views when the custom input view changes.
+ (-[WKContentView inputView]): Changed to return the custom view from the input session if
+ there is one.
+
2015-10-23 Alex Christensen <[email protected]>
Fix CMake compile error and add correct null check
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKFormInputSession.h (191533 => 191534)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKFormInputSession.h 2015-10-24 05:53:44 UTC (rev 191533)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKFormInputSession.h 2015-10-24 15:54:09 UTC (rev 191534)
@@ -36,6 +36,7 @@
#if TARGET_OS_IPHONE
@property (nonatomic, copy) NSString *accessoryViewCustomButtonTitle;
+@property (nonatomic, strong) UIView *customInputView WK_AVAILABLE(NA, WK_IOS_TBA);
#endif
@end
Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (191533 => 191534)
--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm 2015-10-24 05:53:44 UTC (rev 191533)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm 2015-10-24 15:54:09 UTC (rev 191534)
@@ -233,6 +233,7 @@
@implementation WKFormInputSession {
WKContentView *_contentView;
RetainPtr<NSObject <NSSecureCoding>> _userObject;
+ RetainPtr<UIView> _customInputView;
}
- (instancetype)initWithContentView:(WKContentView *)view userObject:(NSObject <NSSecureCoding> *)userObject
@@ -271,6 +272,20 @@
[_contentView reloadInputViews];
}
+- (UIView *)customInputView
+{
+ return _customInputView.get();
+}
+
+- (void)setCustomInputView:(UIView *)customInputView
+{
+ if (customInputView == _customInputView)
+ return;
+
+ _customInputView = customInputView;
+ [_contentView reloadInputViews];
+}
+
- (void)invalidate
{
_contentView = nil;
@@ -974,7 +989,7 @@
else
[self _displayFormNodeInputView];
- return [_inputPeripheral assistantView];
+ return [_formInputSession customInputView] ?: [_inputPeripheral assistantView];
}
- (CGRect)_selectionClipRect
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes