Commit 5fa22083 authored by mjs's avatar mjs
Browse files

WebKit:

	Don't ask for the content policy any more if the previous policies
	said to save - in effect this means to ask only if the previous
	policies said to use the content policy. Also, remove now-useless
	previous content policy parameter from content policy delegate.

        * WebView.subproj/WebControllerPolicyDelegate.h:
        * WebView.subproj/WebDataSourcePrivate.m:
	(-[WebDataSource _setContentPolicy:]): Retain new policy before
	releasing the old one.
        * WebView.subproj/WebDefaultPolicyDelegate.m:
        * WebView.subproj/WebMainResourceClient.m:
	(-[WebMainResourceClient handle:didReceiveResponse:]): Don't ask
	for content policy if the delegate already decided to save.

WebBrowser:

	Adjusted for WebKit API change.

        * BrowserWebController.m:
        (-[BrowserWebController contentPolicyForResponse:andRequest:inFrame:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2622 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent df04e848
2002-11-11 Maciej Stachowiak <mjs@apple.com>
Don't ask for the content policy any more if the previous policies
said to save - in effect this means to ask only if the previous
policies said to use the content policy. Also, remove now-useless
previous content policy parameter from content policy delegate.
* WebView.subproj/WebControllerPolicyDelegate.h:
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSource _setContentPolicy:]): Retain new policy before
releasing the old one.
* WebView.subproj/WebDefaultPolicyDelegate.m:
* WebView.subproj/WebMainResourceClient.m:
(-[WebMainResourceClient handle:didReceiveResponse:]): Don't ask
for content policy if the delegate already decided to save.
2002-11-11 Maciej Stachowiak <mjs@apple.com>
 
Added new policy delegate callback to get the filename - this
......
2002-11-11 Maciej Stachowiak <mjs@apple.com>
Don't ask for the content policy any more if the previous policies
said to save - in effect this means to ask only if the previous
policies said to use the content policy. Also, remove now-useless
previous content policy parameter from content policy delegate.
* WebView.subproj/WebControllerPolicyDelegate.h:
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSource _setContentPolicy:]): Retain new policy before
releasing the old one.
* WebView.subproj/WebDefaultPolicyDelegate.m:
* WebView.subproj/WebMainResourceClient.m:
(-[WebMainResourceClient handle:didReceiveResponse:]): Don't ask
for content policy if the delegate already decided to save.
2002-11-11 Maciej Stachowiak <mjs@apple.com>
 
Added new policy delegate callback to get the filename - this
......
......@@ -257,12 +257,10 @@ typedef enum {
@param response The response for the partially loaded content.
@param request A WebResourceRequest for the partially loaded content.
@param frame The frame which is loading the URL.
@param content policy if one was determined before the load started. nil if none was predetermined.
*/
- (WebContentPolicy *)contentPolicyForResponse:(WebResourceResponse *)response
andRequest:(WebResourceRequest *)request
inFrame:(WebFrame *)frame
withContentPolicy:(WebContentPolicy *)contentPolicy;
inFrame:(WebFrame *)frame;
/*!
......
......@@ -302,8 +302,9 @@ - (void)_setResponse:(WebResourceResponse *)response
- (void) _setContentPolicy:(WebContentPolicy *)policy
{
[policy retain];
[_private->contentPolicy release];
_private->contentPolicy = [policy retain];
_private->contentPolicy = policy;
[self _commitIfReady];
}
......
......@@ -56,8 +56,7 @@ - (void)unableToImplementPolicy:(WebPolicy *)policy error:(WebError *)error forU
- (WebContentPolicy *)contentPolicyForResponse:(WebResourceResponse *)response
andRequest:(WebResourceRequest *)request
inFrame:(WebFrame *)frame
withContentPolicy:(WebContentPolicy *)contentPolicy;
inFrame:(WebFrame *)frame;
{
if([WebController canShowMIMEType:[response contentType]]){
return [WebContentPolicy webPolicyWithContentAction: WebContentPolicyShow andPath:nil];
......
......@@ -144,12 +144,17 @@ -(void)handle:(WebResourceHandle *)h didReceiveResponse:(WebResourceResponse *)r
// Figure out the content policy.
WebContentPolicy *contentPolicy = [dataSource contentPolicy];
contentPolicy = [[[dataSource controller] policyDelegate] contentPolicyForResponse:r
andRequest:[dataSource request]
inFrame:[dataSource webFrame]
withContentPolicy:contentPolicy];
NSString *saveFilename = [[[dataSource controller] policyDelegate] saveFilenameForResponse:r andRequest:[dataSource request]];
[contentPolicy _setPath:saveFilename];
if ([contentPolicy policyAction] != WebPolicySave) {
contentPolicy = [[[dataSource controller] policyDelegate] contentPolicyForResponse:r
andRequest:[dataSource request]
inFrame:[dataSource webFrame]];
}
if ([contentPolicy policyAction] == WebPolicySave) {
NSString *saveFilename = [[[dataSource controller] policyDelegate] saveFilenameForResponse:r andRequest:[dataSource request]];
[contentPolicy _setPath:saveFilename];
}
[dataSource _setContentPolicy:contentPolicy];
......
......@@ -144,12 +144,17 @@ -(void)handle:(WebResourceHandle *)h didReceiveResponse:(WebResourceResponse *)r
// Figure out the content policy.
WebContentPolicy *contentPolicy = [dataSource contentPolicy];
contentPolicy = [[[dataSource controller] policyDelegate] contentPolicyForResponse:r
andRequest:[dataSource request]
inFrame:[dataSource webFrame]
withContentPolicy:contentPolicy];
NSString *saveFilename = [[[dataSource controller] policyDelegate] saveFilenameForResponse:r andRequest:[dataSource request]];
[contentPolicy _setPath:saveFilename];
if ([contentPolicy policyAction] != WebPolicySave) {
contentPolicy = [[[dataSource controller] policyDelegate] contentPolicyForResponse:r
andRequest:[dataSource request]
inFrame:[dataSource webFrame]];
}
if ([contentPolicy policyAction] == WebPolicySave) {
NSString *saveFilename = [[[dataSource controller] policyDelegate] saveFilenameForResponse:r andRequest:[dataSource request]];
[contentPolicy _setPath:saveFilename];
}
[dataSource _setContentPolicy:contentPolicy];
......
......@@ -257,12 +257,10 @@ typedef enum {
@param response The response for the partially loaded content.
@param request A WebResourceRequest for the partially loaded content.
@param frame The frame which is loading the URL.
@param content policy if one was determined before the load started. nil if none was predetermined.
*/
- (WebContentPolicy *)contentPolicyForResponse:(WebResourceResponse *)response
andRequest:(WebResourceRequest *)request
inFrame:(WebFrame *)frame
withContentPolicy:(WebContentPolicy *)contentPolicy;
inFrame:(WebFrame *)frame;
/*!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment