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

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:27:35 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 707938e3867a7773c6d376cb0f0bdd20f1c522b5
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 26 02:26:40 2002 +0000

    	Made some WebPolicy API's private
    	Added support for download link/image to disk
    
            * Misc.subproj/WebDownloadHandler.m:
            (-[WebDownloadHandler receivedData:]):
            * WebKit.pbproj/project.pbxproj:
            * WebView.subproj/WebControllerPolicyHandler.h:
            * WebView.subproj/WebControllerPolicyHandler.m:
            (-[WebPolicyPrivate dealloc]):
            (-[WebPolicy _setPolicyAction:]):
            (-[WebPolicy policyAction]):
            (-[WebPolicy path]):
            (-[WebPolicy _setPath:]):
            (-[WebPolicy dealloc]):
            (+[WebURLPolicy webPolicyWithURLAction:]):
            (+[WebFileURLPolicy webPolicyWithFileAction:]):
            (+[WebContentPolicy webPolicyWithContentAction:andPath:]):
            (+[WebClickPolicy webPolicyWithClickAction:andPath:]):
            * WebView.subproj/WebControllerPolicyHandlerPrivate.h: Added.
            * WebView.subproj/WebDefaultContextMenuHandler.m:
            (-[WebDefaultContextMenuHandler downloadURL:]):
            (-[WebDefaultContextMenuHandler downloadLinkToDisk:]):
            (-[WebDefaultContextMenuHandler openImageInNewWindow:]):
            (-[WebDefaultContextMenuHandler downloadImageToDisk:]):
            * WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient WebResourceHandle:dataDidBecomeAvailable:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1678 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index f1f20ff..b419dcf 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,34 @@
 2002-07-25  Chris Blumenberg  <cblu at apple.com>
 
+	Made some WebPolicy API's private
+	Added support for download link/image to disk
+
+        * Misc.subproj/WebDownloadHandler.m:
+        (-[WebDownloadHandler receivedData:]):
+        * WebKit.pbproj/project.pbxproj:
+        * WebView.subproj/WebControllerPolicyHandler.h:
+        * WebView.subproj/WebControllerPolicyHandler.m:
+        (-[WebPolicyPrivate dealloc]):
+        (-[WebPolicy _setPolicyAction:]):
+        (-[WebPolicy policyAction]):
+        (-[WebPolicy path]):
+        (-[WebPolicy _setPath:]):
+        (-[WebPolicy dealloc]):
+        (+[WebURLPolicy webPolicyWithURLAction:]):
+        (+[WebFileURLPolicy webPolicyWithFileAction:]):
+        (+[WebContentPolicy webPolicyWithContentAction:andPath:]):
+        (+[WebClickPolicy webPolicyWithClickAction:andPath:]):
+        * WebView.subproj/WebControllerPolicyHandlerPrivate.h: Added.
+        * WebView.subproj/WebDefaultContextMenuHandler.m:
+        (-[WebDefaultContextMenuHandler downloadURL:]):
+        (-[WebDefaultContextMenuHandler downloadLinkToDisk:]):
+        (-[WebDefaultContextMenuHandler openImageInNewWindow:]):
+        (-[WebDefaultContextMenuHandler downloadImageToDisk:]):
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient WebResourceHandle:dataDidBecomeAvailable:]):
+
+2002-07-25  Chris Blumenberg  <cblu at apple.com>
+
 	Fixed crasher caused by not retaining the content policy.
 
         * WebView.subproj/WebControllerPolicyHandler.h:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index f1f20ff..b419dcf 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,34 @@
 2002-07-25  Chris Blumenberg  <cblu at apple.com>
 
+	Made some WebPolicy API's private
+	Added support for download link/image to disk
+
+        * Misc.subproj/WebDownloadHandler.m:
+        (-[WebDownloadHandler receivedData:]):
+        * WebKit.pbproj/project.pbxproj:
+        * WebView.subproj/WebControllerPolicyHandler.h:
+        * WebView.subproj/WebControllerPolicyHandler.m:
+        (-[WebPolicyPrivate dealloc]):
+        (-[WebPolicy _setPolicyAction:]):
+        (-[WebPolicy policyAction]):
+        (-[WebPolicy path]):
+        (-[WebPolicy _setPath:]):
+        (-[WebPolicy dealloc]):
+        (+[WebURLPolicy webPolicyWithURLAction:]):
+        (+[WebFileURLPolicy webPolicyWithFileAction:]):
+        (+[WebContentPolicy webPolicyWithContentAction:andPath:]):
+        (+[WebClickPolicy webPolicyWithClickAction:andPath:]):
+        * WebView.subproj/WebControllerPolicyHandlerPrivate.h: Added.
+        * WebView.subproj/WebDefaultContextMenuHandler.m:
+        (-[WebDefaultContextMenuHandler downloadURL:]):
+        (-[WebDefaultContextMenuHandler downloadLinkToDisk:]):
+        (-[WebDefaultContextMenuHandler openImageInNewWindow:]):
+        (-[WebDefaultContextMenuHandler downloadImageToDisk:]):
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient WebResourceHandle:dataDidBecomeAvailable:]):
+
+2002-07-25  Chris Blumenberg  <cblu at apple.com>
+
 	Fixed crasher caused by not retaining the content policy.
 
         * WebView.subproj/WebControllerPolicyHandler.h:
diff --git a/WebKit/Misc.subproj/WebDownloadHandler.m b/WebKit/Misc.subproj/WebDownloadHandler.m
index fa0a8ef..4b64e3d 100644
--- a/WebKit/Misc.subproj/WebDownloadHandler.m
+++ b/WebKit/Misc.subproj/WebDownloadHandler.m
@@ -6,6 +6,7 @@
 //  Copyright (c) 2002 Apple Computer, Inc.
 //
 
+#import <WebKit/WebControllerPolicyHandlerPrivate.h>
 #import <WebKit/WebDownloadHandler.h>
 #import <WebKit/WebDataSourcePrivate.h>
 #import <WebKit/WebKitDebug.h>
@@ -48,7 +49,7 @@
                 newPathWithoutExtension = [NSString stringWithFormat:@"%@-%d", pathWithoutExtension, i];
                 path = [newPathWithoutExtension stringByAppendingPathExtension:extension];
                 if(![fileManager fileExistsAtPath:path]){
-                    //[dataSource _setDownloadPath:path];
+                    [[dataSource contentPolicy] _setPath:path];
                     break;
                 }
             }
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index 6827981..84bd78e 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -263,6 +263,7 @@
 				F5934C8A02E894F50197FBCF,
 				F649E40602EE0D1901CA2ACD,
 				354F260002EF441D0ACA2ACA,
+				3519E9EF02F0DF570ACA2ACA,
 			);
 			isa = PBXHeadersBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -696,6 +697,17 @@
 				);
 			};
 		};
+		3519E9EE02F0DF570ACA2ACA = {
+			isa = PBXFileReference;
+			path = WebControllerPolicyHandlerPrivate.h;
+			refType = 4;
+		};
+		3519E9EF02F0DF570ACA2ACA = {
+			fileRef = 3519E9EE02F0DF570ACA2ACA;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
 		354F25FE02EF441D0ACA2ACA = {
 			isa = PBXFileReference;
 			path = WebDefaultContextMenuHandler.h;
@@ -1083,6 +1095,7 @@
 				3944606F020F50ED0ECA1767,
 				39446064020F50ED0ECA1767,
 				F5927D4A02D253C401CA2DBB,
+				3519E9EE02F0DF570ACA2ACA,
 				35E371B402F0BAC60ACA2ACA,
 				39446065020F50ED0ECA1767,
 				39446066020F50ED0ECA1767,
diff --git a/WebKit/WebView.subproj/WebControllerPolicyDelegate.h b/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
index 30aa7d1..3621285 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
+++ b/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
@@ -7,6 +7,7 @@
 
 #import <Cocoa/Cocoa.h>
 
+ at class WebPolicyPrivate;
 @class WebDataSource;
 @class WebError;
 
@@ -49,14 +50,17 @@ typedef enum {
     WebClickPolicyIgnore = WebPolicyIgnore
 } WebClickAction;
 
+
 @interface WebPolicy : NSObject
 {
-    WebPolicyAction policyAction;
+ at private
+    WebPolicyPrivate *_private;
 }
-- initWithPolicyAction: (WebPolicyAction)action;
 - (WebPolicyAction)policyAction;
+- (NSString *)path;
 @end
 
+
 @interface WebURLPolicy : WebPolicy
 + webPolicyWithURLAction: (WebURLAction)action;
 @end
@@ -66,21 +70,11 @@ typedef enum {
 @end
 
 @interface WebContentPolicy : WebPolicy
-{
-    NSString *path;
-}
 + webPolicyWithContentAction: (WebContentAction)action andPath: (NSString *)thePath;
-- initWithContentPolicyAction: (WebContentAction)action andPath: (NSString *)thePath;
-- (NSString *)path;
 @end
 
 @interface WebClickPolicy : WebPolicy
-{
-    NSString *path;
-}
 + webPolicyWithClickAction: (WebClickAction)action andPath: (NSString *)thePath;
-- initWithClickPolicyAction: (WebClickAction)action andPath: (NSString *)thePath;
-- (NSString *)path;
 @end
 
 
diff --git a/WebKit/WebView.subproj/WebControllerPolicyDelegatePrivate.h b/WebKit/WebView.subproj/WebControllerPolicyDelegatePrivate.h
new file mode 100644
index 0000000..fe04d55
--- /dev/null
+++ b/WebKit/WebView.subproj/WebControllerPolicyDelegatePrivate.h
@@ -0,0 +1,19 @@
+/*
+ *  WebControllerPolicyHandlerPrivate.h
+ *  WebKit
+ *
+ *  Created by Christopher Blumenberg on Thu Jul 25 2002.
+ *  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#import <Cocoa/Cocoa.h>
+
+#import <WebKit/WebControllerPolicyHandler.h>
+
+ at interface WebPolicy (WebPrivate)
+
+- (void)_setPolicyAction:(WebPolicyAction)policyAction;
+- (void)_setPath:(NSString *)path;
+
+ at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WebControllerPolicyHandler.h b/WebKit/WebView.subproj/WebControllerPolicyHandler.h
index 30aa7d1..3621285 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyHandler.h
+++ b/WebKit/WebView.subproj/WebControllerPolicyHandler.h
@@ -7,6 +7,7 @@
 
 #import <Cocoa/Cocoa.h>
 
+ at class WebPolicyPrivate;
 @class WebDataSource;
 @class WebError;
 
@@ -49,14 +50,17 @@ typedef enum {
     WebClickPolicyIgnore = WebPolicyIgnore
 } WebClickAction;
 
+
 @interface WebPolicy : NSObject
 {
-    WebPolicyAction policyAction;
+ at private
+    WebPolicyPrivate *_private;
 }
-- initWithPolicyAction: (WebPolicyAction)action;
 - (WebPolicyAction)policyAction;
+- (NSString *)path;
 @end
 
+
 @interface WebURLPolicy : WebPolicy
 + webPolicyWithURLAction: (WebURLAction)action;
 @end
@@ -66,21 +70,11 @@ typedef enum {
 @end
 
 @interface WebContentPolicy : WebPolicy
-{
-    NSString *path;
-}
 + webPolicyWithContentAction: (WebContentAction)action andPath: (NSString *)thePath;
-- initWithContentPolicyAction: (WebContentAction)action andPath: (NSString *)thePath;
-- (NSString *)path;
 @end
 
 @interface WebClickPolicy : WebPolicy
-{
-    NSString *path;
-}
 + webPolicyWithClickAction: (WebClickAction)action andPath: (NSString *)thePath;
-- initWithClickPolicyAction: (WebClickAction)action andPath: (NSString *)thePath;
-- (NSString *)path;
 @end
 
 
diff --git a/WebKit/WebView.subproj/WebControllerPolicyHandler.m b/WebKit/WebView.subproj/WebControllerPolicyHandler.m
index 6696bf3..01a2216 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyHandler.m
+++ b/WebKit/WebView.subproj/WebControllerPolicyHandler.m
@@ -8,90 +8,97 @@
 
 #import <WebKit/WebControllerPolicyHandler.h>
 
-
- at implementation WebPolicy : NSObject
-- initWithPolicyAction: (WebPolicyAction)action
-{
-    [super init];
-    policyAction = action;
-    return self;
-}
-
-- (WebPolicyAction)policyAction
+ at interface WebPolicyPrivate : NSObject
 {
-    return policyAction;
+ at public
+    WebPolicyAction policyAction;
+    NSString *path;
 }
-
 @end
 
- at implementation WebURLPolicy : WebPolicy
+ at implementation WebPolicyPrivate
 
-+ webPolicyWithURLAction: (WebURLAction)action
+- (void)dealloc
 {
-    return [[[WebURLPolicy alloc] initWithPolicyAction:action] autorelease];
+    [path release];
 }
 
 @end
 
- at implementation WebFileURLPolicy : WebPolicy
-
-+ webPolicyWithFileAction: (WebFileAction)action
+ at implementation WebPolicy
+- initWithPolicyAction: (WebPolicyAction)action andPath:(NSString *)path;
 {
-    return [[[WebURLPolicy alloc] initWithPolicyAction:action] autorelease];
+    [super init];
+    _private = [[WebPolicyPrivate alloc] init];
+    _private->policyAction = action;
+    _private->path = [path retain];
+    return self;
 }
 
- at end
+- (void)_setPolicyAction:(WebPolicyAction)policyAction
+{
+    _private->policyAction = policyAction;
+}
 
- at implementation WebContentPolicy : WebPolicy
+- (WebPolicyAction)policyAction
+{
+    return _private->policyAction;
+}
 
-+ webPolicyWithContentAction: (WebContentAction)action andPath: (NSString *)thePath
+- (NSString *)path
 {
-    return [[[WebContentPolicy alloc] initWithContentPolicyAction:action andPath:thePath] autorelease];
+    return _private->path;
 }
 
-- initWithContentPolicyAction: (WebContentAction)action andPath: (NSString *)thePath
+- (void)_setPath:(NSString *)path
 {
-    [super initWithPolicyAction:action];
-    path = [thePath retain];
-    return self;
+    [_private->path release];
+    _private->path = [path retain];
 }
 
+
 - (void)dealloc
 {
-    [path release];
+    [_private release];
     [super dealloc];
 }
 
-- (NSString *)path
+ at end
+
+ at implementation WebURLPolicy
+
++ webPolicyWithURLAction: (WebURLAction)action
 {
-    return path;
+    return [[[WebPolicy alloc] initWithPolicyAction:action andPath:nil] autorelease];
 }
 
 @end
 
- at implementation WebClickPolicy : WebPolicy
+ at implementation WebFileURLPolicy
 
-- initWithClickPolicyAction: (WebClickAction)action andPath: (NSString *)thePath
++ webPolicyWithFileAction: (WebFileAction)action
 {
-    [super initWithPolicyAction:action];
-    path = [thePath retain];
-    return self;
+    return [[[WebPolicy alloc] initWithPolicyAction:action andPath:nil] autorelease];
 }
 
-+ webPolicyWithClickAction: (WebClickAction)action andPath: (NSString *)thePath
-{
-    return [[[WebClickPolicy alloc] initWithClickPolicyAction:action andPath:thePath] autorelease];
-}
+ at end
 
-- (void)dealloc
+ at implementation WebContentPolicy
+
++ webPolicyWithContentAction: (WebContentAction)action andPath: (NSString *)thePath
 {
-    [path release];
-    [super dealloc];
+    return [[[WebPolicy alloc] initWithPolicyAction:action andPath:thePath] autorelease];
 }
 
-- (NSString *)path
+
+ at end
+
+ at implementation WebClickPolicy
+
++ webPolicyWithClickAction: (WebClickAction)action andPath: (NSString *)thePath
 {
-    return path;
+    return [[[WebPolicy alloc] initWithPolicyAction:action andPath:thePath] autorelease];
 }
 
+
 @end
diff --git a/WebKit/WebView.subproj/WebControllerPolicyHandlerDelegate.h b/WebKit/WebView.subproj/WebControllerPolicyHandlerDelegate.h
new file mode 100644
index 0000000..fe04d55
--- /dev/null
+++ b/WebKit/WebView.subproj/WebControllerPolicyHandlerDelegate.h
@@ -0,0 +1,19 @@
+/*
+ *  WebControllerPolicyHandlerPrivate.h
+ *  WebKit
+ *
+ *  Created by Christopher Blumenberg on Thu Jul 25 2002.
+ *  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#import <Cocoa/Cocoa.h>
+
+#import <WebKit/WebControllerPolicyHandler.h>
+
+ at interface WebPolicy (WebPrivate)
+
+- (void)_setPolicyAction:(WebPolicyAction)policyAction;
+- (void)_setPath:(NSString *)path;
+
+ at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WebControllerPolicyHandlerPrivate.h b/WebKit/WebView.subproj/WebControllerPolicyHandlerPrivate.h
new file mode 100644
index 0000000..fe04d55
--- /dev/null
+++ b/WebKit/WebView.subproj/WebControllerPolicyHandlerPrivate.h
@@ -0,0 +1,19 @@
+/*
+ *  WebControllerPolicyHandlerPrivate.h
+ *  WebKit
+ *
+ *  Created by Christopher Blumenberg on Thu Jul 25 2002.
+ *  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#import <Cocoa/Cocoa.h>
+
+#import <WebKit/WebControllerPolicyHandler.h>
+
+ at interface WebPolicy (WebPrivate)
+
+- (void)_setPolicyAction:(WebPolicyAction)policyAction;
+- (void)_setPath:(NSString *)path;
+
+ at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m b/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
index 84bc76a..095e1f5 100644
--- a/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
@@ -7,7 +7,10 @@
 
 #import <WebKit/WebController.h>
 #import <WebKit/WebDataSource.h>
+#import <WebKit/WebDataSourcePrivate.h>
 #import <WebKit/WebDefaultContextMenuHandler.h>
+#import <WebKit/WebControllerPolicyHandler.h>
+#import <WebKit/WebControllerPolicyHandlerPrivate.h>
 #import <WebKit/WebFrame.h>
 
 @implementation WebDefaultContextMenuHandler
@@ -94,11 +97,32 @@
     [[controller windowContext] openNewWindowWithURL:URL];
 }
 
+- (void)downloadURL:(NSURL *)URL
+{
+    WebFrame *webFrame = [element objectForKey:WebContextFrame];
+    WebController *controller = [webFrame controller];
+    WebDataSource *dataSource = [[WebDataSource alloc] initWithURL:URL];
+
+    // FIXME: This is a hack
+    WebContentPolicy *contentPolicy = [[controller policyHandler] contentPolicyForMIMEType:@"application/octet-stream" dataSource:dataSource];
+    [contentPolicy _setPolicyAction:WebContentPolicySave];
+    [dataSource _setContentPolicy:contentPolicy];
+    if([webFrame setProvisionalDataSource:dataSource]){
+        [webFrame startLoading];
+    }
+    [dataSource release];
+}
+
 - (void)openLinkInNewWindow:(id)sender
 {
     [self openNewWindowWithURL:[element objectForKey:WebContextLinkURL]];
 }
 
+- (void)downloadLinkToDisk:(id)sender
+{
+    [self downloadURL:[element objectForKey:WebContextLinkURL]];
+}
+
 - (void)copyLinkToClipboard:(id)sender
 {
     NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
@@ -114,6 +138,11 @@
     [self openNewWindowWithURL:[element objectForKey:WebContextImageURL]];
 }
 
+- (void)downloadImageToDisk:(id)sender
+{
+    [self downloadURL:[element objectForKey:WebContextImageURL]];
+}
+
 - (void)copyImageToClipboard:(id)sender
 {
     NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
diff --git a/WebKit/WebView.subproj/WebDefaultContextMenuHandler.m b/WebKit/WebView.subproj/WebDefaultContextMenuHandler.m
index 84bc76a..095e1f5 100644
--- a/WebKit/WebView.subproj/WebDefaultContextMenuHandler.m
+++ b/WebKit/WebView.subproj/WebDefaultContextMenuHandler.m
@@ -7,7 +7,10 @@
 
 #import <WebKit/WebController.h>
 #import <WebKit/WebDataSource.h>
+#import <WebKit/WebDataSourcePrivate.h>
 #import <WebKit/WebDefaultContextMenuHandler.h>
+#import <WebKit/WebControllerPolicyHandler.h>
+#import <WebKit/WebControllerPolicyHandlerPrivate.h>
 #import <WebKit/WebFrame.h>
 
 @implementation WebDefaultContextMenuHandler
@@ -94,11 +97,32 @@
     [[controller windowContext] openNewWindowWithURL:URL];
 }
 
+- (void)downloadURL:(NSURL *)URL
+{
+    WebFrame *webFrame = [element objectForKey:WebContextFrame];
+    WebController *controller = [webFrame controller];
+    WebDataSource *dataSource = [[WebDataSource alloc] initWithURL:URL];
+
+    // FIXME: This is a hack
+    WebContentPolicy *contentPolicy = [[controller policyHandler] contentPolicyForMIMEType:@"application/octet-stream" dataSource:dataSource];
+    [contentPolicy _setPolicyAction:WebContentPolicySave];
+    [dataSource _setContentPolicy:contentPolicy];
+    if([webFrame setProvisionalDataSource:dataSource]){
+        [webFrame startLoading];
+    }
+    [dataSource release];
+}
+
 - (void)openLinkInNewWindow:(id)sender
 {
     [self openNewWindowWithURL:[element objectForKey:WebContextLinkURL]];
 }
 
+- (void)downloadLinkToDisk:(id)sender
+{
+    [self downloadURL:[element objectForKey:WebContextLinkURL]];
+}
+
 - (void)copyLinkToClipboard:(id)sender
 {
     NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
@@ -114,6 +138,11 @@
     [self openNewWindowWithURL:[element objectForKey:WebContextImageURL]];
 }
 
+- (void)downloadImageToDisk:(id)sender
+{
+    [self downloadURL:[element objectForKey:WebContextImageURL]];
+}
+
 - (void)copyImageToClipboard:(id)sender
 {
     NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 49fad68..0559ef6 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -188,11 +188,11 @@
         // This happens in the cases mentioned in 2981866 and 2965312.
         downloadProgressHandler = [[[dataSource controller] downloadProgressHandler] retain];
 
-        if([[dataSource contentPolicy] policyAction] == WebContentPolicyNone){
+        if(![dataSource contentPolicy]){
             contentPolicy = [[controller policyHandler] contentPolicyForMIMEType: contentType dataSource: dataSource];
-            policyAction = [contentPolicy policyAction];
             [dataSource _setContentPolicy:contentPolicy];
         }
+        policyAction = [[dataSource contentPolicy] policyAction];
         
         WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "main content type: %s", DEBUG_OBJECT(contentType));
     }
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 49fad68..0559ef6 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -188,11 +188,11 @@
         // This happens in the cases mentioned in 2981866 and 2965312.
         downloadProgressHandler = [[[dataSource controller] downloadProgressHandler] retain];
 
-        if([[dataSource contentPolicy] policyAction] == WebContentPolicyNone){
+        if(![dataSource contentPolicy]){
             contentPolicy = [[controller policyHandler] contentPolicyForMIMEType: contentType dataSource: dataSource];
-            policyAction = [contentPolicy policyAction];
             [dataSource _setContentPolicy:contentPolicy];
         }
+        policyAction = [[dataSource contentPolicy] policyAction];
         
         WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "main content type: %s", DEBUG_OBJECT(contentType));
     }
diff --git a/WebKit/WebView.subproj/WebPolicyDelegate.h b/WebKit/WebView.subproj/WebPolicyDelegate.h
index 30aa7d1..3621285 100644
--- a/WebKit/WebView.subproj/WebPolicyDelegate.h
+++ b/WebKit/WebView.subproj/WebPolicyDelegate.h
@@ -7,6 +7,7 @@
 
 #import <Cocoa/Cocoa.h>
 
+ at class WebPolicyPrivate;
 @class WebDataSource;
 @class WebError;
 
@@ -49,14 +50,17 @@ typedef enum {
     WebClickPolicyIgnore = WebPolicyIgnore
 } WebClickAction;
 
+
 @interface WebPolicy : NSObject
 {
-    WebPolicyAction policyAction;
+ at private
+    WebPolicyPrivate *_private;
 }
-- initWithPolicyAction: (WebPolicyAction)action;
 - (WebPolicyAction)policyAction;
+- (NSString *)path;
 @end
 
+
 @interface WebURLPolicy : WebPolicy
 + webPolicyWithURLAction: (WebURLAction)action;
 @end
@@ -66,21 +70,11 @@ typedef enum {
 @end
 
 @interface WebContentPolicy : WebPolicy
-{
-    NSString *path;
-}
 + webPolicyWithContentAction: (WebContentAction)action andPath: (NSString *)thePath;
-- initWithContentPolicyAction: (WebContentAction)action andPath: (NSString *)thePath;
-- (NSString *)path;
 @end
 
 @interface WebClickPolicy : WebPolicy
-{
-    NSString *path;
-}
 + webPolicyWithClickAction: (WebClickAction)action andPath: (NSString *)thePath;
-- initWithClickPolicyAction: (WebClickAction)action andPath: (NSString *)thePath;
-- (NSString *)path;
 @end
 
 
diff --git a/WebKit/WebView.subproj/WebPolicyDelegatePrivate.h b/WebKit/WebView.subproj/WebPolicyDelegatePrivate.h
new file mode 100644
index 0000000..fe04d55
--- /dev/null
+++ b/WebKit/WebView.subproj/WebPolicyDelegatePrivate.h
@@ -0,0 +1,19 @@
+/*
+ *  WebControllerPolicyHandlerPrivate.h
+ *  WebKit
+ *
+ *  Created by Christopher Blumenberg on Thu Jul 25 2002.
+ *  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#import <Cocoa/Cocoa.h>
+
+#import <WebKit/WebControllerPolicyHandler.h>
+
+ at interface WebPolicy (WebPrivate)
+
+- (void)_setPolicyAction:(WebPolicyAction)policyAction;
+- (void)_setPath:(NSString *)path;
+
+ at end
\ No newline at end of file

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list