Changeset 166933 in webkit
- Timestamp:
- Apr 8, 2014, 10:17:44 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/mac/ChangeLog
r166928 r166933 1 2014-04-08 Dan Bernstein <mitz@apple.com> 2 3 WebKit part of [Cocoa] Add WKFormDelegate 4 https://bugs.webkit.org/show_bug.cgi?id=131343 5 6 Reviewed by Anders Carlsson. 7 8 * MigrateHeaders.make: Added new WebKit2 headers to WEBKIT2_HEADERS. 9 1 10 2014-04-08 Daniel Bates <dabates@apple.com> 2 11 -
trunk/Source/WebKit/mac/MigrateHeaders.make
r166859 r166933 288 288 _WKActivatedElementInfo.h \ 289 289 _WKElementAction.h \ 290 _WKFormDelegate.h \ 291 _WKFormInputSession.h \ 290 292 _WKProcessPoolConfiguration.h \ 291 293 _WKScriptWorld.h \ -
trunk/Source/WebKit2/ChangeLog
r166928 r166933 1 2014-04-08 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] Add WKFormDelegate 4 https://bugs.webkit.org/show_bug.cgi?id=131343 5 6 Reviewed by Anders Carlsson. 7 8 * UIProcess/API/Cocoa/WKWebView.mm: 9 (-[WKWebView _formDelegate]): Added this accessor. 10 (-[WKWebView _setFormDelegate:]): Ditto. 11 * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared _formDelegate property. 12 13 * UIProcess/API/Cocoa/_WKFormDelegate.h: Added. 14 15 * UIProcess/API/Cocoa/_WKFormInputSession.h: Added. 16 17 * UIProcess/ios/WKContentView.h: Moved _webView ivar into the @interface… 18 * UIProcess/ios/WKContentView.mm: …from the @implementation. 19 20 * UIProcess/ios/WKContentViewInteraction.h: Added _formInputSession ivar and 21 formAccessoryView property. 22 * UIProcess/ios/WKContentViewInteraction.mm: 23 (-[WKFormInputSession initWithContentView:userObject:]): Added. 24 (-[WKFormInputSession dealloc]): Added. 25 (-[WKFormInputSession userObject]): Added. 26 (-[WKFormInputSession isValid]): Added. 27 (-[WKFormInputSession accessoryViewCustomButtonTitle]): Added. 28 (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]): Added. 29 (-[WKFormInputSession invalidate]): Added. 30 (-[WKContentView cleanupInteraction]): Invalidate and release the input session. 31 (-[WKContentView formAccessoryView]): Added this accessor. 32 (-[WKContentView _startAssistingNode:userObject:]): Create an input session and message the 33 form delegate. 34 (-[WKContentView _stopAssistingNode]): Invalidate and release the input session. 35 36 * WebKit2.xcodeproj/project.pbxproj: Added references to new files. 37 38 * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Added 39 comment. 40 1 41 2014-04-08 Daniel Bates <dabates@apple.com> 2 42 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r166905 r166933 88 88 _WKRenderingProgressEvents _observedRenderingProgressEvents; 89 89 90 WebKit::WeakObjCPtr<id <_WKFormDelegate>> _formDelegate; 91 90 92 #if PLATFORM(IOS) 91 93 RetainPtr<WKScrollView> _scrollView; … … 1139 1141 } 1140 1142 1143 - (id <_WKFormDelegate>)_formDelegate 1144 { 1145 return _formDelegate.getAutoreleased(); 1146 } 1147 1148 - (void)_setFormDelegate:(id <_WKFormDelegate>)formDelegate 1149 { 1150 _formDelegate = formDelegate; 1151 } 1152 1141 1153 #pragma mark iOS-specific methods 1142 1154 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
r166767 r166933 57 57 @protocol WKHistoryDelegatePrivate; 58 58 @protocol _WKFindDelegate; 59 @protocol _WKFormDelegate; 59 60 60 61 @interface WKWebView (WKPrivate) … … 147 148 - (void)_hideFindUI; 148 149 150 @property (nonatomic, weak, setter=_setFormDelegate:) id <_WKFormDelegate> _formDelegate; 151 149 152 @end 150 153 -
trunk/Source/WebKit2/UIProcess/ios/WKContentView.h
r166658 r166933 49 49 @package 50 50 RefPtr<WebKit::WebPageProxy> _page; 51 WKWebView *_webView; 51 52 } 52 53 -
trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm
r166663 r166933 177 177 RetainPtr<WKInspectorIndicationView> _inspectorIndicationView; 178 178 179 WKWebView *_webView;180 181 179 HistoricalVelocityData _historicalKinematicData; 182 180 } -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h
r166900 r166933 59 59 @class WebIOSEvent; 60 60 @class WKActionSheetAssistant; 61 @class WKFormInputSession; 61 62 62 63 typedef void (^UIWKAutocorrectionCompletionHandler)(UIWKAutocorrectionRects *rectsForInput); … … 97 98 RetainPtr<WKActionSheetAssistant> _actionSheetAssistant; 98 99 RetainPtr<WKAirPlayRoutePicker> _airPlayRoutePicker; 100 RetainPtr<WKFormInputSession> _formInputSession; 99 101 100 102 std::unique_ptr<WebKit::SmartMagnificationController> _smartMagnificationController; … … 124 126 @property (nonatomic, readonly) const WebKit::WKAutoCorrectionData& autocorrectionData; 125 127 @property (nonatomic, readonly) const WebKit::AssistedNodeInformation& assistedNodeInformation; 128 @property (nonatomic, readonly) UIWebFormAccessory *formAccessoryView; 129 126 130 - (void)setupInteraction; 127 131 - (void)cleanupInteraction; -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r166900 r166933 40 40 #import "WKFormInputControl.h" 41 41 #import "WKFormSelectControl.h" 42 #import "WKWebViewPrivate.h" 43 #import "_WKFormDelegate.h" 44 #import "_WKFormInputSession.h" 42 45 #import <DataDetectorsUI/DDDetectionController.h> 43 46 #import <UIKit/_UIHighlightView.h> … … 131 134 @end 132 135 136 @interface WKFormInputSession : NSObject <_WKFormInputSession> 137 138 - (instancetype)initWithContentView:(WKContentView *)view userObject:(NSObject <NSSecureCoding> *)userObject; 139 - (void)invalidate; 140 141 @end 142 143 @implementation WKFormInputSession { 144 WKContentView *_contentView; 145 RetainPtr<NSObject <NSSecureCoding>> _userObject; 146 } 147 148 - (instancetype)initWithContentView:(WKContentView *)view userObject:(NSObject <NSSecureCoding> *)userObject 149 { 150 if (!(self = [super init])) 151 return nil; 152 153 _contentView = view; 154 _userObject = userObject; 155 156 return self; 157 } 158 159 - (NSObject <NSSecureCoding> *)userObject 160 { 161 return _userObject.get(); 162 } 163 164 - (BOOL)isValid 165 { 166 return _contentView != nil; 167 } 168 169 - (NSString *)accessoryViewCustomButtonTitle 170 { 171 return [[[_contentView formAccessoryView] _autofill] title]; 172 } 173 174 - (void)setAccessoryViewCustomButtonTitle:(NSString *)title 175 { 176 if (title.length) 177 [[_contentView formAccessoryView] showAutoFillButtonWithTitle:title]; 178 else 179 [[_contentView formAccessoryView] hideAutoFillButton]; 180 } 181 182 - (void)invalidate 183 { 184 _contentView = nil; 185 } 186 187 @end 188 133 189 @implementation WKContentView (WKInteraction) 134 190 … … 180 236 _textSelectionAssistant = nil; 181 237 _actionSheetAssistant = nil; 238 [_formInputSession invalidate]; 239 _formInputSession = nil; 182 240 [_touchEventGestureRecognizer setDelegate:nil]; 183 241 [_singleTapGestureRecognizer setDelegate:nil]; … … 1875 1933 } 1876 1934 1935 - (UIWebFormAccessory *)formAccessoryView 1936 { 1937 return _formAccessoryView.get(); 1938 } 1939 1877 1940 - (void)_startAssistingNode:(const AssistedNodeInformation&)information userObject:(NSObject <NSSecureCoding> *)userObject 1878 1941 { … … 1900 1963 // _inputPeripheral has been initialized in inputView called by reloadInputViews. 1901 1964 [_inputPeripheral beginEditing]; 1965 1966 id <_WKFormDelegate> formDelegate = [_webView _formDelegate]; 1967 if ([formDelegate respondsToSelector:@selector(_webView:didStartInputSession:)]) { 1968 _formInputSession = adoptNS([[WKFormInputSession alloc] initWithContentView:self userObject:userObject]); 1969 [formDelegate _webView:_webView didStartInputSession:_formInputSession.get()]; 1970 } 1902 1971 } 1903 1972 1904 1973 - (void)_stopAssistingNode 1905 1974 { 1975 [_formInputSession invalidate]; 1976 _formInputSession = nil; 1906 1977 _isEditable = NO; 1907 1978 _assistedNodeInformation.elementType = WKTypeNone; -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r166890 r166933 689 689 37A5E01318BBF937000A081E /* _WKActivatedElementInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37A5E01118BBF937000A081E /* _WKActivatedElementInfo.mm */; }; 690 690 37A5E01418BBF93F000A081E /* _WKActivatedElementInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 37A5E01218BBF937000A081E /* _WKActivatedElementInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; 691 37A64E5518F38E3C00EB30F1 /* _WKFormDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 37A64E5418F38E3C00EB30F1 /* _WKFormDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 692 37A64E5718F38F4600EB30F1 /* _WKFormInputSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 37A64E5618F38F4600EB30F1 /* _WKFormInputSession.h */; settings = {ATTRIBUTES = (Private, ); }; }; 691 693 37C4C08618149C5B003688B9 /* WKBackForwardListItem.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37C4C08418149C5B003688B9 /* WKBackForwardListItem.mm */; }; 692 694 37C4C08718149C5B003688B9 /* WKBackForwardListItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 37C4C08518149C5B003688B9 /* WKBackForwardListItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; … … 2508 2510 37A5E01118BBF937000A081E /* _WKActivatedElementInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKActivatedElementInfo.mm; sourceTree = "<group>"; }; 2509 2511 37A5E01218BBF937000A081E /* _WKActivatedElementInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKActivatedElementInfo.h; sourceTree = "<group>"; }; 2512 37A64E5418F38E3C00EB30F1 /* _WKFormDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKFormDelegate.h; sourceTree = "<group>"; }; 2513 37A64E5618F38F4600EB30F1 /* _WKFormInputSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKFormInputSession.h; sourceTree = "<group>"; }; 2510 2514 37C4C08418149C5B003688B9 /* WKBackForwardListItem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKBackForwardListItem.mm; sourceTree = "<group>"; }; 2511 2515 37C4C08518149C5B003688B9 /* WKBackForwardListItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBackForwardListItem.h; sourceTree = "<group>"; }; … … 4663 4667 379A873B18BBFF0700588AF2 /* _WKElementActionInternal.h */, 4664 4668 005D158E18E4C4EB00734619 /* _WKFindDelegate.h */, 4669 37A64E5418F38E3C00EB30F1 /* _WKFormDelegate.h */, 4670 37A64E5618F38F4600EB30F1 /* _WKFormInputSession.h */, 4665 4671 1A43E828188F3CDC009E4D30 /* _WKProcessPoolConfiguration.h */, 4666 4672 1A43E827188F3CDC009E4D30 /* _WKProcessPoolConfiguration.mm */, … … 7002 7008 1AB8A1F418400B8F00E9AE69 /* WKPageFindClient.h in Headers */, 7003 7009 75E749EA180DBB9800088BA6 /* WebOriginDataManagerMessages.h in Headers */, 7010 37A64E5518F38E3C00EB30F1 /* _WKFormDelegate.h in Headers */, 7004 7011 51ACBBA0127A8F2C00D203B9 /* WebContextMenuProxyMac.h in Headers */, 7005 7012 BCCB75C61203A1CE00222D1B /* WebContextMessageKinds.h in Headers */, … … 7329 7336 BC407604124FF0270068F20A /* WKSerializedScriptValue.h in Headers */, 7330 7337 0FCB4E4C18BBE044000FCFC9 /* WKContentView.h in Headers */, 7338 37A64E5718F38F4600EB30F1 /* _WKFormInputSession.h in Headers */, 7331 7339 1F604BAA1889FBB800EE0395 /* WKRenderingProgressEventsInternal.h in Headers */, 7332 7340 1F7506B81859165D00EC0FF7 /* WKWebProcessPlugInFrameInternal.h in Headers */, -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h
r166900 r166933 38 38 - (void)_webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller didFocusTextField:(WKWebProcessPlugInNodeHandle *)textField inFrame:(WKWebProcessPlugInFrame *)frame; 39 39 - (void)_webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller willSubmitForm:(WKWebProcessPlugInNodeHandle *)form toFrame:(WKWebProcessPlugInFrame *)frame fromFrame:(WKWebProcessPlugInFrame *)sourceFrame withValues:(NSDictionary *)values; 40 41 // The return value is exposed in the UI process via the userObject property of the _WKFormInputSession object. 40 42 - (NSObject <NSSecureCoding> *)_webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller willBeginInputSessionForElement:(WKWebProcessPlugInNodeHandle *)node inFrame:(WKWebProcessPlugInFrame *)frame; 41 43
Note:
See TracChangeset
for help on using the changeset viewer.