Changeset 191534 in webkit


Ignore:
Timestamp:
Oct 24, 2015 8:54:09 AM (9 years ago)
Author:
mitz@apple.com
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.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r191528 r191534  
     12015-10-24  Dan Bernstein  <mitz@apple.com>
     2
     3        [iOS] Allow clients to specify a custom input view to be used for a form input session
     4        https://bugs.webkit.org/show_bug.cgi?id=150395
     5
     6        Reviewed by Tim Horton.
     7
     8        * UIProcess/API/Cocoa/_WKFormInputSession.h: Added customInputView property to the protocol.
     9
     10        * UIProcess/ios/WKContentViewInteraction.mm:
     11        (-[WKFormInputSession customInputView]): Added this getter.
     12        (-[WKFormInputSession setCustomInputView:]): Added this setter, which reloads the input
     13          views when the custom input view changes.
     14        (-[WKContentView inputView]): Changed to return the custom view from the input session if
     15          there is one.
     16
    1172015-10-23  Alex Christensen  <achristensen@webkit.org>
    218
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKFormInputSession.h

    r168541 r191534  
    3737#if TARGET_OS_IPHONE
    3838@property (nonatomic, copy) NSString *accessoryViewCustomButtonTitle;
     39@property (nonatomic, strong) UIView *customInputView WK_AVAILABLE(NA, WK_IOS_TBA);
    3940#endif
    4041
  • trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm

    r191409 r191534  
    234234    WKContentView *_contentView;
    235235    RetainPtr<NSObject <NSSecureCoding>> _userObject;
     236    RetainPtr<UIView> _customInputView;
    236237}
    237238
     
    270271    if (UICurrentUserInterfaceIdiomIsPad())
    271272        [_contentView reloadInputViews];
     273}
     274
     275- (UIView *)customInputView
     276{
     277    return _customInputView.get();
     278}
     279
     280- (void)setCustomInputView:(UIView *)customInputView
     281{
     282    if (customInputView == _customInputView)
     283        return;
     284
     285    _customInputView = customInputView;
     286    [_contentView reloadInputViews];
    272287}
    273288
     
    975990        [self _displayFormNodeInputView];
    976991
    977     return [_inputPeripheral assistantView];
     992    return [_formInputSession customInputView] ?: [_inputPeripheral assistantView];
    978993}
    979994
Note: See TracChangeset for help on using the changeset viewer.