[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:39:30 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 146496953ba3fa488f702c7c855fa79d02ab98a6
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Apr 30 21:49:17 2003 +0000

    WebFoundation:
    
            Reviewed by Darin.
    
    	More authentication API changes. With this change, we actually
    	send the authentication request through the connection delegate,
    	which is the major structural change. Even so, some work remains
    	to be done.
    
            * AuthenticationManager.subproj/NSHTTPAuthenticator.h:
            * AuthenticationManager.subproj/NSHTTPAuthenticator.m:
            (-[NSURLAuthenticationChallengeState initWithConnection:httpRequest:challenge:callback:context:]): Use a connection and dispatcher, not the usual handler array.
            (-[NSURLAuthenticationChallengeState dealloc]): Likewise.
            (-[NSHTTPAuthenticator _tryChallenge:]): Likewise.
            (-[NSHTTPAuthenticator _askDelegateWithURL:realm:forRequest:failureCount:failureResponse:connection:withCallback:context:]): Renamed from _invokeHandlersWithURL... and updated.
            (-[NSHTTPAuthenticator _askDelegateWithURL:proxy:forRequest:failureCount:failureResponse:connection:withCallback:context:]): Likewise.
            (-[NSHTTPAuthenticator NSURLAuthenticationChallenge:useCredential:]): Fix cleanup - no more handlers.
            (-[NSHTTPAuthenticator _internalInit]): Got rid of handler stuff.
            (-[NSHTTPAuthenticator dealloc]): Likewise.
            (-[NSHTTPAuthenticator addCredentialsToRetryHTTPRequest:afterFailureResponse:nsFailureResponse:failureCount:connection:withCallback:context:]):
    	Ask the delegate, not the handlers.
            (-[NSHTTPAuthenticator cancelAddCredentialsToRetryHTTPRequest:]): Likewise.
    
            * AuthenticationManager.subproj/WebAuthenticationRequestPrivate.h:
            * AuthenticationManager.subproj/NSURLAuthenticationChallenge.h:
            * AuthenticationManager.subproj/NSURLAuthenticationChallenge.m:
            (-[NSURLAuthenticationChallenge _useCredential:]): Semi-privatized this method,
    	it will go for real soon but is used as a back channel by NSURLConnection for now.
            (-[NSURLAuthenticationChallenge _cancel]): Likewise.
    
            * AuthenticationManager.subproj/NSURLConnectionAuthenticationChallengeInternal.h:
            * AuthenticationManager.subproj/NSURLConnectionAuthenticationChallenge.m:
            (-[NSURLConnectionAuthenticationChallenge _initWithProtocolChallenge:connection:delegate:]):
    	Temporary private init since we still need the challenge delegate for now.
    
            * AuthenticationManager.subproj/NSURLDownloadAuthenticationChallenge.h: Added.
            * AuthenticationManager.subproj/NSURLProtocolAuthenticationChallenge.h: Updated.
    
            * AuthenticationManager.subproj/WebAuthenticationHandlerDispatcher.h:
            * AuthenticationManager.subproj/WebAuthenticationHandlerDispatcher.m:
    	Renamed class to WebAuthenticationDispatcher.
            (-[WebAuthenticationDispatcher _dispatchStartAuthentication:]): Redone to use
    	connection delegate based auth instead of using an authentication handler.
            (-[WebAuthenticationDispatcher _dispatchCancelAuthentication:]): Likewise.
            (-[WebAuthenticationDispatcher _dispatchAuthenticationDone:]): Likewise.
            (-[WebAuthenticationDispatcher dealloc]): Likewise.
            (-[WebAuthenticationDispatcher startAuthentication:]): Likewise.
            (-[WebAuthenticationDispatcher initWithConnection:]): New init.
    
            * CacheLoader.subproj/NSURLConnectionPrivate.h:
            * CacheLoader.subproj/NSURLConnection.h:
            * CacheLoader.subproj/NSURLConnection.m:
            (-[NSURLConnection useCredential:forAuthenticationChallenge:]): Call challenge
    	(for now).
            (-[NSURLConnection continueWithoutCredentialForAuthenticationChallenge:]):
    	Call challenge (for now).
            (-[NSURLConnection _delegate]): Temporary private method so that NSHTTPAuthenticator
    	can bypass the Protocol <--> ProtocolClient interface and call the delegate directly.
    
            * FileTransfer.subproj/NSURLDownloadPrivate.h: Declared _init methods.
            * FileTransfer.subproj/NSURLDownload.h:
            * FileTransfer.subproj/NSURLDownload.m:
            (-[NSURLDownload _initWithLoadingResource:request:response:delegate:proxy:]): Added.
            (+[NSURLDownload _downloadWithLoadingConnection:request:response:delegate:proxy:]):
    	Use corresponding _init.
            (-[NSURLDownload _initWithSource:delegate:directory:]): Added.
            (+[NSURLDownload _downloadWithSource:delegate:directory:]): Use correspoding _init.
            (-[NSURLDownload _sendDidBeginMessage]): Note that we sent it even if we tried
    	but the delegate does not respond to the begin selector, to avoid failing asserts
    	later otherwise.
            (-[NSURLDownload connection:didReceiveAuthenticationChallenge:]): Forward
    	to delegate or do the default action.
            (-[NSURLDownload connection:didCancelAuthenticationChallenge:]): Likewise.
            (-[NSURLConnectionDelegateProxy respondsToSelector:]): Act like we respond only
    	if the underlying delegate does.
            (-[NSURLConnectionDelegateProxy connection:didReceiveAuthenticationChallenge:]):
    	Pass it along.
            (-[NSURLConnectionDelegateProxy connection:didCancelAuthenticationChallenge:]):
    	Pass it along.
            * AuthenticationManager.subproj/NSURLCredentialStorage.h: Removed authentication handler stuff.
            * AuthenticationManager.subproj/NSURLCredentialStorage.m: Likewise.
    
    WebKit:
    
            Reviewed by Darin.
    
    	- Adjusted for authentication API change - now we expect
    	authentication via the connection delegate, not a separate global
    	authentication handler
    
            * Misc.subproj/WebKit.h: Include WebDownload.h
            * Misc.subproj/WebDownload.h: Added.
            * Misc.subproj/WebDownload.m: Added - this new class is just like NSURLDownload
    	but if the standard auth delegate methods are not implemented, it prompts using
    	the standard AppKit sheet.
            * Panels.subproj/WebPanelAuthenticationHandler.h:
            * Panels.subproj/WebPanelAuthenticationHandler.m:
            (+[WebPanelAuthenticationHandler sharedHandler]): New method to get a shared
    	handler, since we no logner register an instance with WebFoundation.
            (-[WebPanelAuthenticationHandler startAuthentication:window:]): Do things
    	using the new API.
            (-[WebPanelAuthenticationHandler _authenticationDoneWithChallenge:result:]):
    	Likewise.
            * WebKit.exp: Export WebDownload.
            * WebKit.pbproj/project.pbxproj: Add new files to  build.
    
    	- Removed WebStandardPanels - this is removed from the API.
    
    	* Panels.subproj/WebStandardPanels.h: Removed.
            * Panels.subproj/WebStandardPanels.m: Removed.
            * Panels.subproj/WebStandardPanelsPrivate.h: Removed.
            * Panels.subproj/WebAuthenticationPanel.m: Remove WebStandardPanels.h import.
    
    	- Added new resource load delegate auth methods:
    
    	* WebView.subproj/WebResourceLoadDelegate.h:
    
    	- Use WebDownload where appropriate, and remove use of WebStandardPanels:
    
            * WebView.subproj/WebBaseResourceHandleDelegate.h:
            * WebView.subproj/WebBaseResourceHandleDelegate.m:
            (-[WebBaseResourceHandleDelegate connection:didReceiveAuthenticationChallenge:]):
    	Pass to resource load delegate.
    	(-[WebBaseResourceHandleDelegate connection:didCancelAuthenticationChallenge:]):
    	Likewise.
            (-[WebBaseResourceHandleDelegate dealloc]): Don't track currentURL any more.
            (-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]): Likewise.
            (-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]): Likewise.
            (-[WebBaseResourceHandleDelegate connection:didFailLoadingWithError:]): Likewise.
            (-[WebBaseResourceHandleDelegate cancelWithError:]): Likewise.
            * WebView.subproj/WebDefaultResourceLoadDelegate.m:
            (-[WebDefaultResourceLoadDelegate webView:resource:didReceiveAuthenticationChallenge:fromDataSource:]):
    	Prompt using the standard panel.
    
            (-[WebDefaultResourceLoadDelegate webView:resource:didCancelAuthenticationChallenge:fromDataSource:]):
    	Cancel prompting using the standard panel.
            * WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient continueAfterContentPolicy:response:]): Use WebDownload instead
    	of NSURLDownload.
    	* WebView.subproj/WebView.h: Remove unneeded @class directives,
    	and mention WebDownload instead of NSURLDownload.
            * WebView.subproj/WebViewPrivate.h:
            * WebView.subproj/WebViewPrivate.m:
            (-[WebView _downloadURL:toDirectory:]): Use WebDownload instead of NSURLDownload.
            (-[WebView _cacheResourceLoadDelegateImplementations]): Track auth methods too.
    
    WebBrowser:
    
            Reviewed by Darin.
    
    	Updated for new WebKit auth API.
    
            * AppController.m:
            (-[AppController awakeFromNib]): No need to register interest in standard panels.
            * DownloadMonitor.m:
            (-[DownloadMonitor downloadWindowForAuthenticationSheet:]): Implemented this method
    	so we can pop a sheet off the download window when reloading (yay, finally)!
            * DownloadProgressEntry.m:
            (-[DownloadProgressEntry reload]): Use WebDownload not NSURLDownload.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4221 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 96d89bb..20b2cc7 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,67 @@
+2003-04-29  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Darin.
+
+	- Adjusted for authentication API change - now we expect
+	authentication via the connection delegate, not a separate global
+	authentication handler
+
+        * Misc.subproj/WebKit.h: Include WebDownload.h
+        * Misc.subproj/WebDownload.h: Added.
+        * Misc.subproj/WebDownload.m: Added - this new class is just like NSURLDownload
+	but if the standard auth delegate methods are not implemented, it prompts using
+	the standard AppKit sheet.
+        * Panels.subproj/WebPanelAuthenticationHandler.h:
+        * Panels.subproj/WebPanelAuthenticationHandler.m:
+        (+[WebPanelAuthenticationHandler sharedHandler]): New method to get a shared
+	handler, since we no logner register an instance with WebFoundation.
+        (-[WebPanelAuthenticationHandler startAuthentication:window:]): Do things
+	using the new API.
+        (-[WebPanelAuthenticationHandler _authenticationDoneWithChallenge:result:]):
+	Likewise.
+        * WebKit.exp: Export WebDownload.
+        * WebKit.pbproj/project.pbxproj: Add new files to  build.
+
+	- Removed WebStandardPanels - this is removed from the API.
+        
+	* Panels.subproj/WebStandardPanels.h: Removed.
+        * Panels.subproj/WebStandardPanels.m: Removed.
+        * Panels.subproj/WebStandardPanelsPrivate.h: Removed.
+        * Panels.subproj/WebAuthenticationPanel.m: Remove WebStandardPanels.h import.
+
+	- Added new resource load delegate auth methods:
+	
+	* WebView.subproj/WebResourceLoadDelegate.h:
+
+	- Use WebDownload where appropriate, and remove use of WebStandardPanels:
+	
+        * WebView.subproj/WebBaseResourceHandleDelegate.h:
+        * WebView.subproj/WebBaseResourceHandleDelegate.m:
+        (-[WebBaseResourceHandleDelegate connection:didReceiveAuthenticationChallenge:]):
+	Pass to resource load delegate.
+	(-[WebBaseResourceHandleDelegate connection:didCancelAuthenticationChallenge:]):
+	Likewise.
+        (-[WebBaseResourceHandleDelegate dealloc]): Don't track currentURL any more.
+        (-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]): Likewise.
+        (-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]): Likewise.
+        (-[WebBaseResourceHandleDelegate connection:didFailLoadingWithError:]): Likewise.
+        (-[WebBaseResourceHandleDelegate cancelWithError:]): Likewise.
+        * WebView.subproj/WebDefaultResourceLoadDelegate.m:
+        (-[WebDefaultResourceLoadDelegate webView:resource:didReceiveAuthenticationChallenge:fromDataSource:]): 
+	Prompt using the standard panel.
+
+        (-[WebDefaultResourceLoadDelegate webView:resource:didCancelAuthenticationChallenge:fromDataSource:]):
+	Cancel prompting using the standard panel.
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient continueAfterContentPolicy:response:]): Use WebDownload instead
+	of NSURLDownload.
+	* WebView.subproj/WebView.h: Remove unneeded @class directives,
+	and mention WebDownload instead of NSURLDownload.
+        * WebView.subproj/WebViewPrivate.h:
+        * WebView.subproj/WebViewPrivate.m:
+        (-[WebView _downloadURL:toDirectory:]): Use WebDownload instead of NSURLDownload.
+        (-[WebView _cacheResourceLoadDelegateImplementations]): Track auth methods too.
+
 2003-04-30  Ken Kocienda  <kocienda at apple.com>
 
         Reviewed by Darin
diff --git a/WebKit/Misc.subproj/WebDownload.h b/WebKit/Misc.subproj/WebDownload.h
new file mode 100644
index 0000000..4144c1c
--- /dev/null
+++ b/WebKit/Misc.subproj/WebDownload.h
@@ -0,0 +1,44 @@
+/*	WebDownload.h
+        Copyright 2003, Apple, Inc. All rights reserved.
+*/
+
+#import <WebFoundation/NSURLDownload.h>
+
+ at class WebDownloadInternal;
+
+/*!
+    @class WebDownload
+    @discussion A WebDownload works just like an NSURLDownload, with
+    one extra feature: if you do not implement the
+    authentication-related delegate methods, it will automatically
+    prompt for authentication using the standard WebKit authentication
+    panel, as either a sheet or window. It provides no extra methods,
+    but does have one additional delegate method.
+*/
+
+
+ at interface WebDownload : NSURLDownload
+{
+ at private
+    WebDownloadInternal *_webInternal;
+}
+
+ at end
+
+
+/*!
+    @protocol WebDownloadDelegate
+    @discussion The WebDownloadDelegate delegate has one extra method used to choose
+    the right window when automatically prompting with a sheet.
+*/
+ at interface NSObject (WebDownloadDelegate)
+
+/*!
+    @method downloadWindowForAuthenticationSheet:
+    @abstract
+    @param
+    @result
+*/
+- (NSWindow *)downloadWindowForAuthenticationSheet:(WebDownload *)download;
+
+ at end
diff --git a/WebKit/Misc.subproj/WebDownload.m b/WebKit/Misc.subproj/WebDownload.m
new file mode 100644
index 0000000..dbce13e
--- /dev/null
+++ b/WebKit/Misc.subproj/WebDownload.m
@@ -0,0 +1,188 @@
+/*	WebDownload.m
+        Copyright 2003, Apple, Inc. All rights reserved.
+*/
+
+#import <WebKit/WebDownload.h>
+
+#import <WebFoundation/NSURLDownload.h>
+#import <WebFoundation/NSURLDownloadPrivate.h>
+#import <WebKit/WebPanelAuthenticationHandler.h>
+
+ at interface WebDownloadInternal : NSObject
+{
+ at public
+    id realDelegate;
+    WebDownload *webDownload;
+}
+
+- (void)setRealDelegate:(id)rd;
+
+ at end
+
+ at implementation WebDownloadInternal
+
+- (id)initWithDownload:(WebDownload *)dl
+{
+    self = [super init];
+    if (self != nil) {
+	webDownload = [dl retain];
+    }
+    return self;
+}
+
+- (void)dealloc
+{
+    [webDownload release];
+    [realDelegate release];
+}
+
+- (void)setRealDelegate:(id)rd
+{
+    [rd retain];
+    [realDelegate release];
+    realDelegate = rd;
+}
+
+- (BOOL)respondsToSelector:(SEL)selector
+{
+    if (selector == @selector(downloadDidBegin:) ||
+	selector == @selector(download:willSendRequest:redirectResponse:) ||
+	selector == @selector(download:didReceiveResponse:) ||
+	selector == @selector(download:didReceiveDataOfLength:) ||
+	selector == @selector(download:shouldDecodeSourceDataOfMIMEType:) ||
+	selector == @selector(download:decideDestinationWithSuggestedFilename:) ||
+	selector == @selector(download:didCreateDestination:) ||
+	selector == @selector(downloadDidFinish:) ||
+	selector == @selector(download:didFailWithError:) ||
+	selector == @selector(download:shouldBeginChildDownloadOfSource:delegate:) ||
+	selector == @selector(download:didBeginChildDownload:)) {
+	return [realDelegate respondsToSelector:selector];
+    }
+
+    return [super respondsToSelector:selector];
+}
+
+- (void)downloadDidBegin:(NSURLDownload *)download
+{
+    [realDelegate downloadDidBegin:download];
+}
+
+- (NSURLRequest *)download:(NSURLDownload *)download willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse
+{
+    return [realDelegate download:download willSendRequest:request redirectResponse:redirectResponse];
+}
+
+- (void)download:(NSURLDownload *)download didReceiveAuthenticationChallenge:(NSURLDownloadAuthenticationChallenge *)challenge
+{
+    if ([realDelegate respondsToSelector:@selector(download:didReceiveAuthenticationChallenge:)]) {
+	[realDelegate download:download didReceiveAuthenticationChallenge:challenge];
+    } else {
+	NSWindow *window = nil;
+	if ([realDelegate respondsToSelector:@selector(downloadWindowForAuthenticationSheet:)]) {
+	    window = [realDelegate downloadWindowForAuthenticationSheet:webDownload];
+	}
+
+	[[WebPanelAuthenticationHandler sharedHandler] startAuthentication:(NSURLConnectionAuthenticationChallenge *)challenge window:window];
+    }
+}
+
+- (void)download:(NSURLDownload *)download didCancelAuthenticationChallenge:(NSURLDownloadAuthenticationChallenge *)challenge
+{
+    if ([realDelegate respondsToSelector:@selector(download:didCancelAuthenticationChallenge:)]) {
+	[realDelegate download:download didCancelAuthenticationChallenge:challenge];
+    } else {
+	// cancel auth
+    }
+}
+
+- (void)download:(NSURLDownload *)download didReceiveResponse:(NSURLResponse *)response
+{
+    [realDelegate download:download didReceiveResponse:response];
+}
+
+- (void)download:(NSURLDownload *)download didReceiveDataOfLength:(unsigned)length
+{
+    [realDelegate download:download didReceiveDataOfLength:length];
+}
+
+- (BOOL)download:(NSURLDownload *)download shouldDecodeSourceDataOfMIMEType:(NSString *)encodingType
+{
+    return [realDelegate download:download shouldDecodeSourceDataOfMIMEType:encodingType];
+}
+
+- (void)download:(NSURLDownload *)download decideDestinationWithSuggestedFilename:(NSString *)filename
+{
+    [realDelegate download:download decideDestinationWithSuggestedFilename:filename];
+}
+
+- (void)download:(NSURLDownload *)download didCreateDestination:(NSString *)path
+{
+    [realDelegate download:download didCreateDestination:path];
+}
+
+- (void)downloadDidFinish:(NSURLDownload *)download
+{
+    [realDelegate downloadDidFinish:download];
+}
+
+- (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error
+{
+    [realDelegate download:download didFailWithError:error];
+}
+
+- (NSURLRequest *)download:(NSURLDownload *)download shouldBeginChildDownloadOfSource:(NSURLRequest *)child delegate:(id *)childDelegate
+{
+    return [realDelegate download:download shouldBeginChildDownloadOfSource:child delegate:childDelegate];
+}
+
+- (void)download:(NSURLDownload *)parent didBeginChildDownload:(NSURLDownload *)child
+{
+    [realDelegate download:parent didBeginChildDownload:child];
+}
+
+ at end
+
+
+
+ at implementation WebDownload
+
+- (id)init
+{
+    self = [super init];
+    if (self != nil) {
+	_webInternal = [[WebDownloadInternal alloc] init];
+    }
+    return self;
+}
+
+- (id)initWithSource:(NSURLRequest *)request delegate:(id)delegate
+{
+    self = [self init];
+    [_webInternal setRealDelegate:delegate];
+    [super initWithSource:request delegate:_webInternal];
+    return self;
+}
+
+- (id)_initWithLoadingResource:(NSURLConnection *)connection
+                       request:(NSURLRequest *)request
+                      response:(NSURLResponse *)response
+                      delegate:(id)delegate
+                         proxy:(NSURLConnectionDelegateProxy *)proxy;
+{
+    self = [self init];
+    [_webInternal setRealDelegate:delegate];
+    [super _initWithLoadingResource:connection request:request response:response delegate:_webInternal proxy:proxy];
+    return self;
+}
+
+- (id)_initWithSource:(NSURLRequest *)request
+             delegate:(id)delegate
+            directory:(NSString *)directory
+{
+    self = [self init];
+    [_webInternal setRealDelegate:delegate];
+    [super _initWithSource:request delegate:_webInternal directory:directory];
+    return self;
+}
+
+ at end
diff --git a/WebKit/Misc.subproj/WebKit.h b/WebKit/Misc.subproj/WebKit.h
index 747b18d..3d359d6 100644
--- a/WebKit/Misc.subproj/WebKit.h
+++ b/WebKit/Misc.subproj/WebKit.h
@@ -8,6 +8,7 @@
 #import <WebKit/WebBackForwardList.h>
 #import <WebKit/WebDataSource.h>
 #import <WebKit/WebDocument.h>
+#import <WebKit/WebDownload.h>
 #import <WebKit/WebFrame.h>
 #import <WebKit/WebFrameLoadDelegate.h>
 #import <WebKit/WebFrameView.h>
@@ -17,6 +18,5 @@
 #import <WebKit/WebPreferences.h>
 #import <WebKit/WebPolicyDelegate.h>
 #import <WebKit/WebResourceLoadDelegate.h>
-#import <WebKit/WebStandardPanels.h>
 #import <WebKit/WebView.h>
 #import <WebKit/WebUIDelegate.h>
diff --git a/WebKit/Panels.subproj/WebAuthenticationPanel.m b/WebKit/Panels.subproj/WebAuthenticationPanel.m
index 1940ffc..402a4c6 100644
--- a/WebKit/Panels.subproj/WebAuthenticationPanel.m
+++ b/WebKit/Panels.subproj/WebAuthenticationPanel.m
@@ -12,7 +12,6 @@
 #import <WebFoundation/WebNSURLExtras.h>
 
 #import <WebKit/WebNSControlExtras.h>
-#import <WebKit/WebStandardPanelsPrivate.h>
 
 #define WebAuthenticationPanelNibName @"WebAuthenticationPanel"
 
diff --git a/WebKit/Panels.subproj/WebPanelAuthenticationHandler.h b/WebKit/Panels.subproj/WebPanelAuthenticationHandler.h
index 7954168..65230d2 100644
--- a/WebKit/Panels.subproj/WebPanelAuthenticationHandler.h
+++ b/WebKit/Panels.subproj/WebPanelAuthenticationHandler.h
@@ -7,11 +7,16 @@
 #import <Foundation/Foundation.h>
 #import <WebFoundation/NSURLCredentialStorage.h>
 
+ at class NSURLConnectionAuthenticationChallenge;
 
- at interface WebPanelAuthenticationHandler : NSObject <WebAuthenticationHandler>
+ at interface WebPanelAuthenticationHandler : NSObject
 {
     NSMutableDictionary *windowToPanel;
     NSMutableDictionary *challengeToWindow;
 }
 
++ (id)sharedHandler;
+- (void)startAuthentication:(NSURLConnectionAuthenticationChallenge *)challenge window:(NSWindow *)w;
+- (void)cancelAuthentication:(NSURLConnectionAuthenticationChallenge *)challenge;
+
 @end
diff --git a/WebKit/Panels.subproj/WebPanelAuthenticationHandler.m b/WebKit/Panels.subproj/WebPanelAuthenticationHandler.m
index 202ff21..0f00ea9 100644
--- a/WebKit/Panels.subproj/WebPanelAuthenticationHandler.m
+++ b/WebKit/Panels.subproj/WebPanelAuthenticationHandler.m
@@ -7,13 +7,24 @@
 
 #import <WebKit/WebPanelAuthenticationHandler.h>
 #import <WebKit/WebAuthenticationPanel.h>
-#import <WebKit/WebStandardPanels.h>
 #import <WebFoundation/WebNSDictionaryExtras.h>
+#import <WebFoundation/NSURLConnectionAuthenticationChallenge.h>
 
 static NSString *WebModalDialogPretendWindow = @"WebModalDialogPretendWindow";
 
 @implementation WebPanelAuthenticationHandler
 
+WebPanelAuthenticationHandler *sharedHandler;
+
++ (id)sharedHandler
+{
+    if (sharedHandler == nil) {
+	sharedHandler = [[self alloc] init];
+    }
+
+    return sharedHandler;
+}
+
 -(id)init
 {
     self = [super init];
@@ -31,28 +42,16 @@ static NSString *WebModalDialogPretendWindow = @"WebModalDialogPretendWindow";
     [super dealloc];
 }
 
-// WebAuthenticationHandler methods
--(BOOL)isReadyToStartAuthentication:(NSURLAuthenticationChallenge *)challenge
+-(void)startAuthentication:(NSURLConnectionAuthenticationChallenge *)challenge window:(NSWindow *)w
 {
-    id window = [[WebStandardPanels sharedStandardPanels] frontmostWindowLoadingURL:[[challenge protectionSpace] URL]];
-
-    if (window == nil) {
-        window = WebModalDialogPretendWindow;
+    if ([w attachedSheet] != nil) {
+	w = nil;
     }
 
-    return [windowToPanel objectForKey:window] == nil;
-}
-
--(void)startAuthentication:(NSURLAuthenticationChallenge *)challenge
-{
-    id window = [[WebStandardPanels sharedStandardPanels] frontmostWindowLoadingURL:[[challenge protectionSpace] URL]];
-
-    if (window == nil) {
-        window = WebModalDialogPretendWindow;
-    }
+    id window = w ? (id)w : (id)WebModalDialogPretendWindow;
 
     if ([windowToPanel objectForKey:window] != nil) {
-        [challenge cancel];
+        [[challenge connection] cancel];
         return;
     }
 
@@ -77,7 +76,7 @@ static NSString *WebModalDialogPretendWindow = @"WebModalDialogPretendWindow";
     }
 }
 
--(void)_authenticationDoneWithChallenge:(NSURLAuthenticationChallenge *)challenge result:(NSURLCredential *)credential
+-(void)_authenticationDoneWithChallenge:(NSURLConnectionAuthenticationChallenge *)challenge result:(NSURLCredential *)credential
 {
     id window = [challengeToWindow objectForKey:challenge];
     if (window != nil) {
@@ -85,7 +84,7 @@ static NSString *WebModalDialogPretendWindow = @"WebModalDialogPretendWindow";
         [challengeToWindow removeObjectForKey:challenge];
     }
 
-    [challenge useCredential:credential];
+    [[challenge connection] useCredential:credential forAuthenticationChallenge:challenge];
 }
 
 @end
diff --git a/WebKit/Panels.subproj/WebStandardPanels.h b/WebKit/Panels.subproj/WebStandardPanels.h
deleted file mode 100644
index 52150c1..0000000
--- a/WebKit/Panels.subproj/WebStandardPanels.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*	
-        WebStandardPanels.h
-        Copyright 2002 Apple, Inc. All rights reserved.
-        
-        Public header file.
-*/
-
-#import <Cocoa/Cocoa.h>
-
- at class WebStandardPanelsPrivate;
-
-/*!
-    @class WebStandardPanels
-    @discussion This class allows the use of standard, WebKit-provided
-    panels for particular UI that requires panel interaction. The only
-    one available currently is authentication.
-*/
- at interface WebStandardPanels : NSObject
-{
- at private
-    WebStandardPanelsPrivate *_privatePanels;
-}
-
-/*!
-    @method sharedStandardPanels
-    @abstract Get the shared singleton standard panels object
-    @result The shared standard panels instance
-*/
-+(WebStandardPanels *)sharedStandardPanels;
-
-/*!
-    @method setUsesStandardAuthenticationPanel:
-    @abstract Request that the standard authentication panel be used or not used.
-    @param use YES if the standard authentication panel should be used, NO otherwise
-*/
--(void)setUsesStandardAuthenticationPanel:(BOOL)use;
-
-/*!
-    @method usesStandardAuthenticationPanel
-    @abstract Determine whether the standard authentication panel will be used or not used.
-    @result YES if the standard authentication panel should be used, NO otherwise
-*/
--(BOOL)usesStandardAuthenticationPanel;
-
-/*!
-    @method didStartLoadingURL:inWindow:
-    @abstract Notify the standard panel mechanism of the start of a resource load
-    @param URL The URL that is starting to load
-    @param window The window associated with the load.
-    @discussion This is only needed for resources that are not being
-    loaded via WebKit. WebKit takes care of this bookkeeping
-    automatically for resources that it loads.
-*/
--(void)didStartLoadingURL:(NSURL *)URL inWindow:(NSWindow *)window;
-
-/*!
-    @method didStopLoadingURL:inWindow:
-    @abstract Notify the standard panel mechanism of the end of a resource load
-    @param URL The URL that finished loading
-    @param window The window associated with the load.
-    @discussion This is only needed for resources that are not being
-    loaded via WebKit. WebKit takes care of this bookkeeping
-    automatically for resources that it loads.
-*/
--(void)didStopLoadingURL:(NSURL *)URL inWindow:(NSWindow *)window;
-
-/*!
-    @method frontmostWindowLoadingURL:
-    @abstract Get the frontmost window loading a URL
-    @param URL The URL in question
-    @result The frontmost window loading the given URL
-    @discussion This may be useful for clients that want to implement their
-    own custom panels for special purposes.
-*/
--(NSWindow *)frontmostWindowLoadingURL:(NSURL *)URL;
-
- at end
diff --git a/WebKit/Panels.subproj/WebStandardPanels.m b/WebKit/Panels.subproj/WebStandardPanels.m
deleted file mode 100644
index ef4dcd2..0000000
--- a/WebKit/Panels.subproj/WebStandardPanels.m
+++ /dev/null
@@ -1,229 +0,0 @@
-/*	
-    WebStandardPanels.h
-    
-    Copyright 2002 Apple, Inc. All rights reserved.
-*/
-
-#import <WebKit/WebStandardPanels.h>
-
-#import <WebKit/WebFrame.h>
-#import <WebKit/WebFrameView.h>
-#import <WebKit/WebPanelAuthenticationHandler.h>
-#import <WebKit/WebStandardPanelsPrivate.h>
-
-#import <WebFoundation/WebAssertions.h>
-#import <WebFoundation/NSURLCredentialStorage.h>
-
-#import <Carbon/Carbon.h>
-
- at interface WebStandardPanelsPrivate : NSObject
-{
- at public
-    WebPanelAuthenticationHandler *panelAuthenticationHandler;
-    NSMutableDictionary *URLContainers;
-}
- at end
-
- at implementation WebStandardPanelsPrivate
-
--(id)init
-{
-    self = [super init];
-    if (self != nil) {
-	URLContainers = [[NSMutableDictionary alloc] init];
-    }
-    return self;
-}
-    
--(void)dealloc
-{
-    [URLContainers release];
-    [panelAuthenticationHandler release];
-    [super dealloc];
-}
-
- at end
-
- at implementation WebStandardPanels
-
-// Private init method to implement the singleton pattern
--(id)_init
-{
-    self = [super init];
-    if (self != nil) {
-        _privatePanels = [[WebStandardPanelsPrivate alloc] init];
-    }
-    return self;
-}
-
--(id)init
-{
-    // FIXME: should assert instead (or return a reference to the shared instance)
-    [self release];
-    return nil;
-}
-
--(void)dealloc
-{
-    [_privatePanels release];
-    [super dealloc];
-}
-
-static WebStandardPanels *sharedStandardPanels = NULL;
-
-static void initSharedStandardPanels(void)
-{
-    sharedStandardPanels = [[WebStandardPanels alloc] _init];
-}
-
-+(WebStandardPanels *)sharedStandardPanels
-{
-    static pthread_once_t sharedStandardPanelsOnce = PTHREAD_ONCE_INIT;
-    pthread_once(&sharedStandardPanelsOnce, initSharedStandardPanels);
-    return sharedStandardPanels;
-}
-
--(void)setUsesStandardAuthenticationPanel:(BOOL)use
-{
-    if (use) {
-        if (![self usesStandardAuthenticationPanel]) {
-            _privatePanels->panelAuthenticationHandler = [[WebPanelAuthenticationHandler alloc] init];
-            [[NSURLCredentialStorage sharedURLCredentialStorage] addAuthenticationHandler:_privatePanels->panelAuthenticationHandler];
-        }
-    } else {
-        if ([self usesStandardAuthenticationPanel]) {
-            [[NSURLCredentialStorage sharedURLCredentialStorage] removeAuthenticationHandler:_privatePanels->panelAuthenticationHandler];
-            [_privatePanels->panelAuthenticationHandler release];
-            _privatePanels->panelAuthenticationHandler = nil;
-        }        
-    }
-}
-
--(BOOL)usesStandardAuthenticationPanel
-{
-    return _privatePanels->panelAuthenticationHandler != nil;
-}
-
--(void)didStartLoadingURL:(NSURL *)URL inWindow:(NSWindow *)window
-{
-    ASSERT_ARG(URL, URL);
-    ASSERT_ARG(window, window);
-    
-    NSString *URLString = [URL absoluteString];
-    
-    NSCountedSet *set = [_privatePanels->URLContainers objectForKey:URLString];
-
-    if (set == nil) {
-	set = [NSCountedSet set];
-	[_privatePanels->URLContainers setObject:set forKey:URLString];
-    }
-
-    [set addObject:window];
-}
-
--(void)didStopLoadingURL:(NSURL *)URL inWindow:(NSWindow *)window
-{
-    ASSERT_ARG(URL, URL);
-    ASSERT_ARG(window, window);
-    
-    NSString *URLString = [URL absoluteString];
-    
-    NSCountedSet *set = [_privatePanels->URLContainers objectForKey:URLString];
-
-    ASSERT([set containsObject:window]);
-
-    if (set == nil) {
-	return;
-    }
-
-    [set removeObject:window];
-    
-    if ([set count] == 0) {
-	[_privatePanels->URLContainers removeObjectForKey:URLString];
-    }
-}
-
--(void)_didStartLoadingURL:(NSURL *)URL inController:(WebView *)webView
-{
-    ASSERT_ARG(URL, URL);
-    ASSERT_ARG(webView, webView);
-    
-    NSString *URLString = [URL absoluteString];
-    
-    NSCountedSet *set = [_privatePanels->URLContainers objectForKey:URLString];
-
-    if (set == nil) {
-	set = [NSCountedSet set];
-	[_privatePanels->URLContainers setObject:set forKey:URLString];
-    }
-
-    [set addObject:webView];
-}
-
--(void)_didStopLoadingURL:(NSURL *)URL inController:(WebView *)webView
-{
-    ASSERT_ARG(URL, URL);
-    ASSERT_ARG(webView, webView);
-    
-    NSString *URLString = [URL absoluteString];
-    
-    NSCountedSet *set = [_privatePanels->URLContainers objectForKey:URLString];
-
-    ASSERT([set containsObject:webView]);
-
-    if (set == nil) {
-	return;
-    }
-
-    [set removeObject:webView];
-    
-    if ([set count] == 0) {
-	[_privatePanels->URLContainers removeObjectForKey:URLString];
-    }
-}
-
-static BOOL WindowInFront(NSWindow *a, NSWindow *b)
-{
-    UInt32 aIndex;
-    UInt32 bIndex;
-
-    GetWindowIndex([a windowRef], NULL, kWindowGroupContentsReturnWindows, &aIndex);
-    GetWindowIndex([b windowRef], NULL, kWindowGroupContentsReturnWindows, &bIndex);
-
-    return aIndex < bIndex;
-    // void NSWindowList(int size, int list[])
-    // void NSCountWindowsForContext(int context, int *count)
-    // void NSWindowListForContext(int context, int size, int list[])
-}
-
--(NSWindow *)frontmostWindowLoadingURL:(NSURL *)URL
-{
-    NSString *URLString = [URL absoluteString];
-    
-    NSCountedSet *set = [_privatePanels->URLContainers objectForKey:URLString];
-
-    if (set == nil) {
-	return nil;
-    }
-
-    NSEnumerator *enumerator = [set objectEnumerator];
-    NSWindow *frontmostWindow = nil;
-    id object;
-
-    while ((object = [enumerator nextObject]) != nil) {
-	NSWindow *window;
-	if ([object isKindOfClass:[NSWindow class]]) {
-	    window = object;
-	} else {
-	    window = [[[object mainFrame] frameView] window];
-	}
-
-	if (window != nil && [window isVisible] && (frontmostWindow == nil || WindowInFront(window, frontmostWindow))) {
-	    frontmostWindow = window;
-	}
-    }
-
-    return frontmostWindow;
-}
-
- at end
diff --git a/WebKit/Panels.subproj/WebStandardPanelsPrivate.h b/WebKit/Panels.subproj/WebStandardPanelsPrivate.h
deleted file mode 100644
index 01c995e..0000000
--- a/WebKit/Panels.subproj/WebStandardPanelsPrivate.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*	
-    WebStandardPanelsPrivate.h
-    
-    Copyright 2002 Apple, Inc. All rights reserved.
-*/
-
-#import <WebKit/WebStandardPanels.h>
-#import <WebKit/WebView.h>
-
- at interface WebStandardPanels (Private)
-
--(void)_didStartLoadingURL:(NSURL *)URL inController:(WebView *)controller;
--(void)_didStopLoadingURL:(NSURL *)URL inController:(WebView *)controller;
-
- at end
diff --git a/WebKit/WebKit.exp b/WebKit/WebKit.exp
index 9840fb2..e492d62 100644
--- a/WebKit/WebKit.exp
+++ b/WebKit/WebKit.exp
@@ -3,6 +3,7 @@
 .objc_class_name_WebDataSource
 .objc_class_name_WebDebugDOMNode
 .objc_class_name_WebDefaultPolicyDelegate
+.objc_class_name_WebDownload
 .objc_class_name_WebDynamicScrollBarsView
 .objc_class_name_WebFormDelegate
 .objc_class_name_WebFrame
@@ -17,7 +18,6 @@
 .objc_class_name_WebKitStatistics
 .objc_class_name_WebPreferences
 .objc_class_name_WebRenderNode
-.objc_class_name_WebStandardPanels
 .objc_class_name_WebStringTruncator
 .objc_class_name_WebTextView
 .objc_class_name_WebURLsWithTitles
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index d0007f7..365b9ae 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -215,8 +215,6 @@
 				517FA6AC03709FCE00CA2D3A,
 				F8CA15B9029A39D901000122,
 				93154EF303A41270008635CE,
-				F8CA15BB029A39D901000122,
-				F8CA15C2029A3E0D01000122,
 				F5A672BD0263866E01000102,
 				F5EBC45802134BC301CA1520,
 				931A72D303265920008635CE,
@@ -293,6 +291,8 @@
 				70ECD6CE043B727400A80181,
 				515E27CD0458C86500CA2D3A,
 				515E27D10458CA4B00CA2D3A,
+				65840820045E752600000128,
+				6578F5E0045F817400000128,
 			);
 			isa = PBXHeadersBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -340,7 +340,6 @@
 				517FA6AE03709FCE00CA2D3A,
 				F8CA15BA029A39D901000122,
 				93154EF403A41270008635CE,
-				F8CA15BC029A39D901000122,
 				F5A672BE0263866E01000102,
 				F5EBC45A02134BC301CA1520,
 				83E4AF49036652150000E506,
@@ -404,6 +403,7 @@
 				51443F9E0429392B00CA2D3A,
 				70ECD6CF043B727400A80181,
 				515E27D20458CA4B00CA2D3A,
+				6578F5E1045F817400000128,
 			);
 			isa = PBXSourcesBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -501,6 +501,8 @@
 				517FA6A903709FCE00CA2D3A,
 				517FA6AA03709FCE00CA2D3A,
 				517FA6AB03709FCE00CA2D3A,
+				6578F5DE045F817400000128,
+				6578F5DF045F817400000128,
 			);
 			isa = PBXGroup;
 			name = Misc;
@@ -1496,6 +1498,33 @@
 			shellPath = /bin/sh;
 			shellScript = "if [ \"x$RC_RELEASE\" = \"xPanther\" ]; then\n    install_name_tool -id \"${SYSTEM_LIBRARY_DIR}/PrivateFrameworks/WebKit.framework/Versions/A/WebKit\" \"${SYMROOT}/WebKit.framework/Versions/A/WebKit\" ;\n    ditto \"${SYMROOT}/WebKit.framework\" \"${DSTROOT}/${SYSTEM_LIBRARY_DIR}/PrivateFrameworks/WebKit.framework\" ;\n    strip -S ${DSTROOT}/\"${SYSTEM_LIBRARY_DIR}/PrivateFrameworks/WebKit.framework/Versions/A/WebKit\";\nelse\n    ditto \"${SYMROOT}/WebKit.framework\" \"${DSTROOT}/AppleInternal/Library/Frameworks/WebKit.framework\"\n    strip -S \"${DSTROOT}/AppleInternal/Library/Frameworks/WebKit.framework/Versions/A/WebKit\"\nfi";
 		};
+		6578F5DE045F817400000128 = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			path = WebDownload.h;
+			refType = 4;
+		};
+		6578F5DF045F817400000128 = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			path = WebDownload.m;
+			refType = 4;
+		};
+		6578F5E0045F817400000128 = {
+			fileRef = 6578F5DE045F817400000128;
+			isa = PBXBuildFile;
+			settings = {
+				ATTRIBUTES = (
+					Public,
+				);
+			};
+		};
+		6578F5E1045F817400000128 = {
+			fileRef = 6578F5DF045F817400000128;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
 		657D8FA10366687600FA1ED0 = {
 			fileRef = 513D422E034CF55A00CA2ACD;
 			isa = PBXBuildFile;
@@ -1562,6 +1591,18 @@
 			settings = {
 			};
 		};
+		6584081F045E752600000128 = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			path = WebAuthenticationChallenge.h;
+			refType = 4;
+		};
+		65840820045E752600000128 = {
+			fileRef = 6584081F045E752600000128;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
 //650
 //651
 //652
@@ -2233,6 +2274,7 @@
 				51A8B57A042834F700CA2D3A,
 				51A8B57D0428353A00CA2D3A,
 				51A8B57E0428353A00CA2D3A,
+				6584081F045E752600000128,
 			);
 			isa = PBXGroup;
 			name = WebView;
@@ -3654,10 +3696,6 @@
 				F8CA15B6029A39D901000122,
 				93154EF103A41270008635CE,
 				93154EF203A41270008635CE,
-				F8CA15B7029A39D901000122,
-				F8CA15B8029A39D901000122,
-				F8CA15C1029A3E0D01000122,
-				F8CA15C1029A3E0D01000122,
 				9345D17B0365BF35008635CE,
 			);
 			isa = PBXGroup;
@@ -3677,18 +3715,6 @@
 			path = WebAuthenticationPanel.m;
 			refType = 4;
 		};
-		F8CA15B7029A39D901000122 = {
-			fileEncoding = 30;
-			isa = PBXFileReference;
-			path = WebStandardPanels.h;
-			refType = 4;
-		};
-		F8CA15B8029A39D901000122 = {
-			fileEncoding = 30;
-			isa = PBXFileReference;
-			path = WebStandardPanels.m;
-			refType = 4;
-		};
 		F8CA15B9029A39D901000122 = {
 			fileRef = F8CA15B5029A39D901000122;
 			isa = PBXBuildFile;
@@ -3701,33 +3727,6 @@
 			settings = {
 			};
 		};
-		F8CA15BB029A39D901000122 = {
-			fileRef = F8CA15B7029A39D901000122;
-			isa = PBXBuildFile;
-			settings = {
-				ATTRIBUTES = (
-					Public,
-				);
-			};
-		};
-		F8CA15BC029A39D901000122 = {
-			fileRef = F8CA15B8029A39D901000122;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
-		F8CA15C1029A3E0D01000122 = {
-			fileEncoding = 30;
-			isa = PBXFileReference;
-			path = WebStandardPanelsPrivate.h;
-			refType = 4;
-		};
-		F8CA15C2029A3E0D01000122 = {
-			fileRef = F8CA15C1029A3E0D01000122;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
 	};
 	rootObject = 0867D690FE84028FC02AAC07;
 }
diff --git a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
index 403d19d..20cd6dd 100644
--- a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
+++ b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
@@ -26,7 +26,6 @@
     id identifier;
     id resourceLoadDelegate;
     id downloadDelegate;
-    NSURL *currentURL;
     BOOL reachedTerminalState;
     BOOL defersCallbacks;
     WebResourceDelegateImplementationCache implementations;
diff --git a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
index 690d71f..a6135b6 100644
--- a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
+++ b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
@@ -19,7 +19,6 @@
 #import <WebKit/WebDefaultResourceLoadDelegate.h>
 #import <WebKit/WebKitErrors.h>
 #import <WebKit/WebResourceLoadDelegate.h>
-#import <WebKit/WebStandardPanelsPrivate.h>
 #import <WebKit/WebViewPrivate.h>
 
 @implementation WebBaseResourceHandleDelegate
@@ -61,7 +60,6 @@
     [self _releaseResources];
     [request release];
     [response release];
-    [currentURL release];
     [super dealloc];
 }
 
@@ -169,18 +167,9 @@
     // Store a copy of the request.
     [request autorelease];
 
-    if (currentURL) {
-        [[WebStandardPanels sharedStandardPanels] _didStopLoadingURL:currentURL inController:controller];
-        [currentURL release];
-        currentURL = nil;
-    }
-    
     // Client may return a nil request, indicating that the request should be aborted.
     if (newRequest){
         request = [newRequest copy];
-        currentURL = [[request URL] retain];
-        if (currentURL)
-            [[WebStandardPanels sharedStandardPanels] _didStartLoadingURL:currentURL inController:controller];
     }
     else {
         request = nil;
@@ -189,6 +178,28 @@
     return request;
 }
 
+- (void)connection:(NSURLConnection *)con didReceiveAuthenticationChallenge:(NSURLConnectionAuthenticationChallenge *)challenge
+{
+    ASSERT(con == connection);
+    ASSERT(!reachedTerminalState);
+
+    if (implementations.delegateImplementsDidReceiveAuthenticationChallenge)
+        [resourceLoadDelegate webView:controller resource:identifier didReceiveAuthenticationChallenge:challenge fromDataSource:dataSource];
+    else
+        [[WebDefaultResourceLoadDelegate sharedResourceLoadDelegate] webView:controller resource:identifier didReceiveAuthenticationChallenge:challenge fromDataSource:dataSource];
+}
+
+-(void)connection:(NSURLConnection *)con didCancelAuthenticationChallenge:(NSURLConnectionAuthenticationChallenge *)challenge
+{
+    ASSERT(con == connection);
+    ASSERT(!reachedTerminalState);
+
+    if (implementations.delegateImplementsDidCancelAuthenticationChallenge)
+        [resourceLoadDelegate webView:controller resource:identifier didCancelAuthenticationChallenge:challenge fromDataSource:dataSource];
+    else
+        [[WebDefaultResourceLoadDelegate sharedResourceLoadDelegate] webView:controller resource:identifier didCancelAuthenticationChallenge:challenge fromDataSource:dataSource];
+}
+
 - (void)connection:(NSURLConnection *)con didReceiveResponse:(NSURLResponse *)r
 {
     ASSERT(con == connection);
@@ -237,9 +248,6 @@
     else
         [[WebDefaultResourceLoadDelegate sharedResourceLoadDelegate] webView:controller resource:identifier didFinishLoadingFromDataSource:dataSource];
 
-    ASSERT(currentURL);
-    [[WebStandardPanels sharedStandardPanels] _didStopLoadingURL:currentURL inController:controller];
-
     [self _releaseResources];
 }
 
@@ -250,10 +258,6 @@
     
     [[controller _resourceLoadDelegateForwarder] webView:controller resource:identifier didFailLoadingWithError:result fromDataSource:dataSource];
 
-    // currentURL may be nil if the request was aborted
-    if (currentURL)
-        [[WebStandardPanels sharedStandardPanels] _didStopLoadingURL:currentURL inController:controller];
-
     [self _releaseResources];
 }
 
@@ -263,10 +267,6 @@
 
     [connection cancel];
     
-    // currentURL may be nil if the request was aborted
-    if (currentURL)
-        [[WebStandardPanels sharedStandardPanels] _didStopLoadingURL:currentURL inController:controller];
-
     if (error) {
         [[controller _resourceLoadDelegateForwarder] webView:controller resource:identifier didFailLoadingWithError:error fromDataSource:dataSource];
     }
diff --git a/WebKit/WebView.subproj/WebDefaultResourceLoadDelegate.m b/WebKit/WebView.subproj/WebDefaultResourceLoadDelegate.m
index e73150c..e469235 100644
--- a/WebKit/WebView.subproj/WebDefaultResourceLoadDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultResourceLoadDelegate.m
@@ -3,13 +3,16 @@
      Copyright 2003, Apple, Inc. All rights reserved.
 */
 
+#import <WebKit/WebDefaultResourceLoadDelegate.h>
+
 #import <WebFoundation/NSURLRequest.h>
 #import <WebFoundation/NSURLConnection.h>
+#import <WebFoundation/NSURLConnectionAuthenticationChallenge.h>
 #import <WebFoundation/NSURLResponse.h>
 #import <WebFoundation/WebNSErrorExtras.h>
 
 #import <WebKit/WebDataSource.h>
-#import <WebKit/WebDefaultResourceLoadDelegate.h>
+#import <WebKit/WebPanelAuthenticationHandler.h>
 #import <WebKit/WebView.h>
 
 
@@ -37,6 +40,18 @@ static WebDefaultResourceLoadDelegate *sharedDelegate = nil;
     return newRequest;
 }
 
+- (void)webView:(WebView *)wv resource:(id)identifier didReceiveAuthenticationChallenge:(NSURLConnectionAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource
+{
+    NSWindow *window = [wv hostWindow] ? [wv hostWindow] : [wv window];
+    [[WebPanelAuthenticationHandler sharedHandler] startAuthentication:challenge window:window];
+}
+
+- (void)webView:(WebView *)wv resource:(id)identifier didCancelAuthenticationChallenge:(NSURLConnectionAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource
+{
+    [(WebPanelAuthenticationHandler *)[WebPanelAuthenticationHandler sharedHandler] cancelAuthentication:challenge];
+}
+
+
 -(void)webView: (WebView *)wv resource:identifier didReceiveResponse: (NSURLResponse *)response fromDataSource:(WebDataSource *)dataSource
 {
 }
diff --git a/WebKit/WebView.subproj/WebLoader.h b/WebKit/WebView.subproj/WebLoader.h
index 403d19d..20cd6dd 100644
--- a/WebKit/WebView.subproj/WebLoader.h
+++ b/WebKit/WebView.subproj/WebLoader.h
@@ -26,7 +26,6 @@
     id identifier;
     id resourceLoadDelegate;
     id downloadDelegate;
-    NSURL *currentURL;
     BOOL reachedTerminalState;
     BOOL defersCallbacks;
     WebResourceDelegateImplementationCache implementations;
diff --git a/WebKit/WebView.subproj/WebLoader.m b/WebKit/WebView.subproj/WebLoader.m
index 690d71f..a6135b6 100644
--- a/WebKit/WebView.subproj/WebLoader.m
+++ b/WebKit/WebView.subproj/WebLoader.m
@@ -19,7 +19,6 @@
 #import <WebKit/WebDefaultResourceLoadDelegate.h>
 #import <WebKit/WebKitErrors.h>
 #import <WebKit/WebResourceLoadDelegate.h>
-#import <WebKit/WebStandardPanelsPrivate.h>
 #import <WebKit/WebViewPrivate.h>
 
 @implementation WebBaseResourceHandleDelegate
@@ -61,7 +60,6 @@
     [self _releaseResources];
     [request release];
     [response release];
-    [currentURL release];
     [super dealloc];
 }
 
@@ -169,18 +167,9 @@
     // Store a copy of the request.
     [request autorelease];
 
-    if (currentURL) {
-        [[WebStandardPanels sharedStandardPanels] _didStopLoadingURL:currentURL inController:controller];
-        [currentURL release];
-        currentURL = nil;
-    }
-    
     // Client may return a nil request, indicating that the request should be aborted.
     if (newRequest){
         request = [newRequest copy];
-        currentURL = [[request URL] retain];
-        if (currentURL)
-            [[WebStandardPanels sharedStandardPanels] _didStartLoadingURL:currentURL inController:controller];
     }
     else {
         request = nil;
@@ -189,6 +178,28 @@
     return request;
 }
 
+- (void)connection:(NSURLConnection *)con didReceiveAuthenticationChallenge:(NSURLConnectionAuthenticationChallenge *)challenge
+{
+    ASSERT(con == connection);
+    ASSERT(!reachedTerminalState);
+
+    if (implementations.delegateImplementsDidReceiveAuthenticationChallenge)
+        [resourceLoadDelegate webView:controller resource:identifier didReceiveAuthenticationChallenge:challenge fromDataSource:dataSource];
+    else
+        [[WebDefaultResourceLoadDelegate sharedResourceLoadDelegate] webView:controller resource:identifier didReceiveAuthenticationChallenge:challenge fromDataSource:dataSource];
+}
+
+-(void)connection:(NSURLConnection *)con didCancelAuthenticationChallenge:(NSURLConnectionAuthenticationChallenge *)challenge
+{
+    ASSERT(con == connection);
+    ASSERT(!reachedTerminalState);
+
+    if (implementations.delegateImplementsDidCancelAuthenticationChallenge)
+        [resourceLoadDelegate webView:controller resource:identifier didCancelAuthenticationChallenge:challenge fromDataSource:dataSource];
+    else
+        [[WebDefaultResourceLoadDelegate sharedResourceLoadDelegate] webView:controller resource:identifier didCancelAuthenticationChallenge:challenge fromDataSource:dataSource];
+}
+
 - (void)connection:(NSURLConnection *)con didReceiveResponse:(NSURLResponse *)r
 {
     ASSERT(con == connection);
@@ -237,9 +248,6 @@
     else
         [[WebDefaultResourceLoadDelegate sharedResourceLoadDelegate] webView:controller resource:identifier didFinishLoadingFromDataSource:dataSource];
 
-    ASSERT(currentURL);
-    [[WebStandardPanels sharedStandardPanels] _didStopLoadingURL:currentURL inController:controller];
-
     [self _releaseResources];
 }
 
@@ -250,10 +258,6 @@
     
     [[controller _resourceLoadDelegateForwarder] webView:controller resource:identifier didFailLoadingWithError:result fromDataSource:dataSource];
 
-    // currentURL may be nil if the request was aborted
-    if (currentURL)
-        [[WebStandardPanels sharedStandardPanels] _didStopLoadingURL:currentURL inController:controller];
-
     [self _releaseResources];
 }
 
@@ -263,10 +267,6 @@
 
     [connection cancel];
     
-    // currentURL may be nil if the request was aborted
-    if (currentURL)
-        [[WebStandardPanels sharedStandardPanels] _didStopLoadingURL:currentURL inController:controller];
-
     if (error) {
         [[controller _resourceLoadDelegateForwarder] webView:controller resource:identifier didFailLoadingWithError:error fromDataSource:dataSource];
     }
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 42a5d8c..6470fc5 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -21,6 +21,7 @@
 #import <WebKit/WebDataSourcePrivate.h>
 #import <WebKit/WebDefaultPolicyDelegate.h>
 #import <WebKit/WebDocument.h>
+#import <WebKit/WebDownload.h>
 #import <WebKit/WebFrameLoadDelegate.h>
 #import <WebKit/WebFrameView.h>
 #import <WebKit/WebFramePrivate.h>
@@ -28,7 +29,6 @@
 #import <WebKit/WebKitErrorsPrivate.h>
 #import <WebKit/WebKitLogging.h>
 #import <WebKit/WebPolicyDelegatePrivate.h>
-#import <WebKit/WebStandardPanelsPrivate.h>
 #import <WebKit/WebViewPrivate.h>
 
 // FIXME: More that is in common with WebSubresourceClient should move up into WebBaseResourceHandleDelegate.
@@ -170,11 +170,11 @@
 
     case WebPolicyDownload:
         [proxy setDelegate:nil];
-        [NSURLDownload _downloadWithLoadingConnection:connection
-                                              request:request
-                                             response:r
-                                             delegate:[self downloadDelegate]
-                                                proxy:proxy];
+        [WebDownload _downloadWithLoadingConnection:connection
+                                            request:request
+                                           response:r
+                                           delegate:[self downloadDelegate]
+                                              proxy:proxy];
         [proxy release];
         proxy = nil;
         [self receivedError:[self interruptForPolicyChangeError]];
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 42a5d8c..6470fc5 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -21,6 +21,7 @@
 #import <WebKit/WebDataSourcePrivate.h>
 #import <WebKit/WebDefaultPolicyDelegate.h>
 #import <WebKit/WebDocument.h>
+#import <WebKit/WebDownload.h>
 #import <WebKit/WebFrameLoadDelegate.h>
 #import <WebKit/WebFrameView.h>
 #import <WebKit/WebFramePrivate.h>
@@ -28,7 +29,6 @@
 #import <WebKit/WebKitErrorsPrivate.h>
 #import <WebKit/WebKitLogging.h>
 #import <WebKit/WebPolicyDelegatePrivate.h>
-#import <WebKit/WebStandardPanelsPrivate.h>
 #import <WebKit/WebViewPrivate.h>
 
 // FIXME: More that is in common with WebSubresourceClient should move up into WebBaseResourceHandleDelegate.
@@ -170,11 +170,11 @@
 
     case WebPolicyDownload:
         [proxy setDelegate:nil];
-        [NSURLDownload _downloadWithLoadingConnection:connection
-                                              request:request
-                                             response:r
-                                             delegate:[self downloadDelegate]
-                                                proxy:proxy];
+        [WebDownload _downloadWithLoadingConnection:connection
+                                            request:request
+                                           response:r
+                                           delegate:[self downloadDelegate]
+                                              proxy:proxy];
         [proxy release];
         proxy = nil;
         [self receivedError:[self interruptForPolicyChangeError]];
diff --git a/WebKit/WebView.subproj/WebResourceLoadDelegate.h b/WebKit/WebView.subproj/WebResourceLoadDelegate.h
index 736f7b0..349eb99 100644
--- a/WebKit/WebView.subproj/WebResourceLoadDelegate.h
+++ b/WebKit/WebView.subproj/WebResourceLoadDelegate.h
@@ -8,6 +8,7 @@
 @class WebDataSource;
 @class NSURLResponse;
 @class NSURLRequest;
+ at class NSURLConnectionAuthenticationChallenge;
 
 /*!
     @category  WebResourceLoadDelegate
@@ -54,6 +55,24 @@
 -(NSURLRequest *)webView:(WebView *)sender resource:identifier willSendRequest: (NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)dataSource;
 
 /*!
+    @method webView:resource:didReceiveAuthenticationChallenge:fromDataSource:
+    @abstract Start authentication for the resource, providing a challenge
+    @discussion Call useCredential::, continueWithoutCredential or
+    cancel on the challenge when done.
+    @param challenge The NSURLConnectionAuthenticationChallenge to start authentication for
+    @discussion If you do not implement this delegate method, WebKit will handle authentication
+    automatically by prompting with a sheet on the window that the WebView is associated with.
+*/
+- (void)webView:(WebView *)sender resource:(id)identifier didReceiveAuthenticationChallenge:(NSURLConnectionAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource;
+
+/*!
+    @method webView:resource:didCancelAuthenticationChallenge:fromDataSource:
+    @abstract Cancel authentication for a given request
+    @param challenge The WebAuthenticationChallenge to cancel authentication for
+*/
+- (void)webView:(WebView *)sender resource:(id)identifier didCancelAuthenticationChallenge:(NSURLConnectionAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource;
+
+/*!
     @method resource:didReceiveResponse:fromDataSource:
     @abstract This message is sent after a response has been received for this load.
     @param webView The WebView sending the message.
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index 0a11e22..9f2b650 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -12,8 +12,6 @@
 @class WebViewPrivate;
 @class WebDataSource;
 @class WebFrame;
- at class NSURLConnection;
- at class NSURLDownload;
 @class WebPreferences;
 @class WebFrameView;
 
@@ -132,16 +130,16 @@ extern NSString *WebElementLinkLabelKey;	// NSString of the text within the anch
 
 /*!
     @method setDownloadDelegate:
-    @abstract Set the WebView's NSURLDownloadDelegate.
-    @discussion The download delegate is retained by NSURLDownload when any downloads are in progress.
-    @param delegate The NSURLDownloadDelegate to set as the download delegate.
+    @abstract Set the WebView's WebDownloadDelegate.
+    @discussion The download delegate is retained by WebDownload when any downloads are in progress.
+    @param delegate The WebDownloadDelegate to set as the download delegate.
 */    
 - (void)setDownloadDelegate: (id)delegate;
 
 /*!
     @method downloadDelegate
-    @abstract Return the WebView's NSURLDownloadDelegate.
-    @result The WebView's NSURLDownloadDelegate.
+    @abstract Return the WebView's WebDownloadDelegate.
+    @result The WebView's WebDownloadDelegate.
 */    
 - (id)downloadDelegate;
 
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index b7a48b0..b950170 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -19,6 +19,8 @@ enum { NumUserAgentStringTypes = WinIE + 1 };
 #define NUM_LOCATION_CHANGE_DELEGATE_SELECTORS	10
 
 typedef struct _WebResourceDelegateImplementationCache {
+    uint delegateImplementsDidCancelAuthenticationChallenge:1;
+    uint delegateImplementsDidReceiveAuthenticationChallenge:1;
     uint delegateImplementsDidReceiveResponse:1;
     uint delegateImplementsDidReceiveContentLength:1;
     uint delegateImplementsDidFinishLoadingFromDataSource:1;
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index 88610f5..431614e 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -10,6 +10,7 @@
 #import <WebKit/WebDefaultPolicyDelegate.h>
 #import <WebKit/WebDefaultResourceLoadDelegate.h>
 #import <WebKit/WebDefaultUIDelegate.h>
+#import <WebKit/WebDownload.h>
 #import <WebKit/WebFormDelegatePrivate.h>
 #import <WebKit/WebFrameLoadDelegate.h>
 #import <WebKit/WebFramePrivate.h>
@@ -18,7 +19,6 @@
 #import <WebKit/WebNSPasteboardExtras.h>
 #import <WebKit/WebPreferencesPrivate.h>
 #import <WebKit/WebResourceLoadDelegate.h>
-#import <WebKit/WebStandardPanelsPrivate.h>
 #import <WebKit/WebViewPrivate.h>
 #import <WebKit/WebUIDelegate.h>
 
@@ -229,9 +229,9 @@
     ASSERT(URL);
     
     NSURLRequest *request = [[NSURLRequest alloc] initWithURL:URL];
-    [NSURLDownload _downloadWithSource:request
-                              delegate:_private->downloadDelegate
-                             directory:[directory isAbsolutePath] ? directory : nil];
+    [WebDownload _downloadWithSource:request
+                            delegate:_private->downloadDelegate
+                           directory:[directory isAbsolutePath] ? directory : nil];
     [request release];
 }
 
@@ -465,6 +465,12 @@
 
 - (void)_cacheResourceLoadDelegateImplementations
 {
+    if ([[self resourceLoadDelegate] respondsToSelector:@selector(webView:resource:didCancelAuthenticationChallenge:fromDataSource:)])
+        _private->resourceLoadDelegateImplementations.delegateImplementsDidCancelAuthenticationChallenge = YES;
+
+    if ([[self resourceLoadDelegate] respondsToSelector:@selector(webView:resource:didReceiveAuthenticationChallenge:fromDataSource:)])
+        _private->resourceLoadDelegateImplementations.delegateImplementsDidReceiveAuthenticationChallenge = YES;
+
     if ([[self resourceLoadDelegate] respondsToSelector:@selector(webView:resource:didFinishLoadingFromDataSource:)])
         _private->resourceLoadDelegateImplementations.delegateImplementsDidFinishLoadingFromDataSource = YES;
     if ([[self resourceLoadDelegate] respondsToSelector:@selector(webView:resource:didReceiveContentLength:fromDataSource:)])

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list