[Qt] [WK2] Expose onNavigationRequested signal instead of expecting a slot be defined from QML
For some context, see the thread https://lists.webkit.org/pipermail/webkit-qt/2011-October/001984.html
Created attachment 116260 [details] Patch
Comment on attachment 116260 [details] Patch lgtm
Comment on attachment 116260 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=116260&action=review > Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp:57 > + void download() { m_action = WKFramePolicyListenerDownload; } I don't like the API. onNavigationRequested { request.download() } feels like it will actually do the download in a sense that I will download the request itself (a bit like file.open()). Maybe the name is just bad. Perhaps we should do like request.action = NavigationRequest.Download or request.action = NavigationRequest.Ignore or request.action = NavigationRequest.Use (the later should probably get another name).
(In reply to comment #4) > (From update of attachment 116260 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=116260&action=review > > > Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp:57 > > + void download() { m_action = WKFramePolicyListenerDownload; } > > I don't like the API. onNavigationRequested { request.download() } feels like it will actually do the download in a sense that I will download the request itself (a bit like file.open()). Maybe the name is just bad. Perhaps we should do like request.action = NavigationRequest.Download or request.action = NavigationRequest.Ignore or request.action = NavigationRequest.Use (the later should probably get another name). We could name it triggerDownload(), to signal that it's not immediate? If we do enums I'd prefer if they were part of the WebView namespace, so action = WebView.AcceptRequest|WebView.IgnoreRequest|WebView.DownloadRequest
(In reply to comment #5) > (In reply to comment #4) > > (From update of attachment 116260 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=116260&action=review > > > > > Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp:57 > > > + void download() { m_action = WKFramePolicyListenerDownload; } > > > > I don't like the API. onNavigationRequested { request.download() } feels like it will actually do the download in a sense that I will download the request itself (a bit like file.open()). Maybe the name is just bad. Perhaps we should do like request.action = NavigationRequest.Download or request.action = NavigationRequest.Ignore or request.action = NavigationRequest.Use (the later should probably get another name). > > We could name it triggerDownload(), to signal that it's not immediate? If we do enums I'd prefer if they were part of the WebView namespace, so action = WebView.AcceptRequest|WebView.IgnoreRequest|WebView.DownloadRequest I prefer the second option much better :D
Created attachment 116268 [details] Patch
This patch depends on bug 72959, that's why is not applying.
Comment on attachment 116268 [details] Patch I prefer like this :D
Comment on attachment 116268 [details] Patch LGTM :)
Created attachment 116352 [details] Patch
Comment on attachment 116352 [details] Patch lgtm
Committed r101086: <http://trac.webkit.org/changeset/101086>