[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:28:07 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 66564783e10f2e0723a08656961f75975c2ba3fa
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Mar 7 07:26:36 2003 +0000

    WebKit:
    
            Reviewed by Trey.
    
    	Step towards policy API changes. Remove WebPolicyNone,
    	WebPolicyRevealInFinder, WebPolicyOpenURL and WebPolicyShow.
    
            * WebView.subproj/WebControllerPolicyDelegate.h:
            * WebView.subproj/WebDefaultPolicyDelegate.m:
            (-[WebDefaultPolicyDelegate decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]):
            * WebView.subproj/WebFramePrivate.m:
            (switch):
            * WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient continueAfterContentPolicy:response:]):
    
    WebBrowser:
    
            Reviewed by Trey.
    
    	Updated for WebKit API changes. Handle removed convenience
    	policies internally.
    
            * BrowserWebController.m:
            (-[BrowserWebController unableToImplementPolicyWithError:inFrame:]):
            (-[BrowserWebController openFileExternallyWithRequest:inFrame:]):
            (-[BrowserWebController openURLExternallyWithRequest:inFrame:]):
            (-[BrowserWebController revealInFinderWithRequest:inFrame:]):
            (-[BrowserWebController contentPolicyForMIMEType:andRequest:inFrame:]):
            (-[BrowserWebController decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3775 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 4996d7e..7b0fd8a 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,18 @@
+2003-03-06  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Trey.
+
+	Step towards policy API changes. Remove WebPolicyNone,
+	WebPolicyRevealInFinder, WebPolicyOpenURL and WebPolicyShow.
+	
+        * WebView.subproj/WebControllerPolicyDelegate.h:
+        * WebView.subproj/WebDefaultPolicyDelegate.m:
+        (-[WebDefaultPolicyDelegate decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]):
+        * WebView.subproj/WebFramePrivate.m:
+        (switch):
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient continueAfterContentPolicy:response:]):
+
 2003-03-06  Richard Williamson   <rjw at apple.com>
 
         Remove setWebView: from WebFrame.
diff --git a/WebKit/WebView.subproj/WebControllerPolicyDelegate.h b/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
index de07d81..68a5769 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
+++ b/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
@@ -45,26 +45,18 @@ extern NSString *WebActionOriginalURLKey; // NSURL
 /*!
     @enum WebPolicyAction
     @abstract Potential actions to take when loading a URL
-    @constant WebPolicyNone Unitialized state.
     @constant WebPolicyUse Have WebKit use the resource.
-    @constant WebPolicyRevealInFinder Reveal the file in the Finder.
     @constant WebPolicySave Save the resource to disk.
-    @constant WebPolicyOpenURL Open the URL in another application.
     @constant WebPolicyOpenNewWindow Open the resource in another window.
     @constant WebPolicyOpenNewWindowBehind Open the resource in another window behind this window.
     @constant WebPolicyIgnore Do nothing with the resource.
-    @constant WebPolicyShow Description forthcoming.
 */
 typedef enum {
-    WebPolicyNone,
     WebPolicyUse,
-    WebPolicyRevealInFinder,
     WebPolicySave,
-    WebPolicyOpenURL,
     WebPolicyOpenNewWindow,
     WebPolicyOpenNewWindowBehind,
     WebPolicyIgnore,
-    WebPolicyShow
 } WebPolicyAction;
 
 
@@ -82,15 +74,15 @@ typedef enum {
 
 
 /*!
-    @category WebControllerPolicyDelegate
-    @discussion While loading a URL, WebKit asks the WebControllerPolicyDelegate for
+    @category WebPolicyDelegate
+    @discussion While loading a URL, WebKit asks the WebPolicyDelegate for
     policies that determine the action of what to do with the URL or the data that
     the URL represents. Typically, the policy handler methods are called in this order:
 
     decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:<BR>
     contentPolicyForMIMEType:andRequest:inFrame:<BR>
 */
- at interface NSObject (WebControllerPolicyDelegate)
+ at interface NSObject (WebPolicyDelegate)
 
 /*!
      @method decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:
diff --git a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
index e290c1b..1e0d001 100644
--- a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
@@ -43,12 +43,12 @@ static WebDefaultPolicyDelegate *sharedDelegate = nil;
 	if(isDirectory)
 	    return WebPolicyIgnore;
 	if([WebContentTypes canShowMIMEType:type])
-	    return WebPolicyShow;
+	    return WebPolicyUse;
 	return WebPolicyIgnore;
     }
 
     if ([WebContentTypes canShowMIMEType:type]) {
-        return WebPolicyShow;
+        return WebPolicyUse;
     } else {
         return WebPolicyIgnore;
     }
@@ -61,8 +61,13 @@ static WebDefaultPolicyDelegate *sharedDelegate = nil;
 {
     if ([WebResource canInitWithRequest:request]) {
 	[listener usePolicy:WebPolicyUse];
-    }else{
-        [listener usePolicy:WebPolicyOpenURL];
+    } else {
+	// A file URL shouldn't fall through to here, but if it did,
+	// it would be a security risk to open it.
+	if (![[request URL] isFileURL]) {
+	    [[NSWorkspace sharedWorkspace] openURL:[request URL]];
+	}
+        [listener usePolicy:WebPolicyIgnore];
     }
 }
 
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index d45197a..7c296d1 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -1345,17 +1345,6 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     switch (policy) {
     case WebPolicyIgnore:
         break;
-    case WebPolicyOpenURL:
-        if ([[request URL] isFileURL]) {
-            if (![[NSWorkspace sharedWorkspace] openFile:[[request URL] path]]) {
-                [self _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotFindApplicationForFile forURL:[request URL]];
-            }
-        } else {
-            if (![[NSWorkspace sharedWorkspace] openURL:[request URL]]) {
-                [self _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotFindApplicationForURL forURL:[request URL]];
-            }
-        }
-        break;
     case WebPolicyOpenNewWindow:
         [[self controller] _openNewWindowWithRequest:request behind:NO];
         break;
@@ -1365,14 +1354,6 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     case WebPolicySave:
         [[self controller] _downloadURL:[request URL]];
         break;
-    case WebPolicyRevealInFinder:
-        if (![[request URL] isFileURL]) {
-            [NSException raise:NSInvalidArgumentException
-                        format:@"clickPolicyForElement:button:modifierFlags: returned an invalid WebClickPolicy"];
-        } else if (![[NSWorkspace sharedWorkspace] selectFile:[[request URL] path] inFileViewerRootedAtPath:@""]) {
-            [self _handleUnimplementablePolicyWithErrorCode:WebKitErrorFinderCannotOpenDirectory forURL:[request URL]];
-        }
-        break;
     case WebPolicyUse:
         if (![WebResource canInitWithRequest:request]) {
             [self _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotShowURL forURL:[request URL]];
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 612f198..e8513c1 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -161,7 +161,7 @@
     WebRequest *req = [dataSource request];
 
     switch (contentPolicy) {
-    case WebPolicyShow:
+    case WebPolicyUse:
 	if (![WebContentTypes canShowMIMEType:[r contentType]]) {
 	    [[dataSource webFrame] _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotShowMIMEType forURL:[req URL]];
 	    [self stopLoadingForPolicyChange];
@@ -186,32 +186,6 @@
         [self interruptForPolicyChangeAndKeepLoading:YES];
         break;
 
-    case WebPolicyOpenURL:
-	if ([[req URL] isFileURL]) {
-	    if(![[NSWorkspace sharedWorkspace] openFile:[[req URL] path]]){
-		[[dataSource webFrame] _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotFindApplicationForFile forURL:[req URL]];
-	    }
-	} else {
-	    if(![[NSWorkspace sharedWorkspace] openURL:[req URL]]){
-		[[dataSource webFrame] _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotFindApplicationForURL forURL:[req URL]];
-	    }
-	}
-
-	[self stopLoadingForPolicyChange];
-	return;
-	break;
-	
-    case WebPolicyRevealInFinder:
-	if (![[req URL] isFileURL]) {
-	    ERROR("contentPolicyForMIMEType:andRequest:inFrame: returned an invalid content policy.");
-	} else if (![[NSWorkspace sharedWorkspace] selectFile:[[req URL] path] inFileViewerRootedAtPath:@""]) {
-	    [[dataSource webFrame] _handleUnimplementablePolicyWithErrorCode:WebKitErrorFinderCannotOpenDirectory forURL:[req URL]];
-	}
-
-	[self stopLoadingForPolicyChange];
-	return;
-	break;
-    
     case WebPolicyIgnore:
 	[self stopLoadingForPolicyChange];
 	return;
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 612f198..e8513c1 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -161,7 +161,7 @@
     WebRequest *req = [dataSource request];
 
     switch (contentPolicy) {
-    case WebPolicyShow:
+    case WebPolicyUse:
 	if (![WebContentTypes canShowMIMEType:[r contentType]]) {
 	    [[dataSource webFrame] _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotShowMIMEType forURL:[req URL]];
 	    [self stopLoadingForPolicyChange];
@@ -186,32 +186,6 @@
         [self interruptForPolicyChangeAndKeepLoading:YES];
         break;
 
-    case WebPolicyOpenURL:
-	if ([[req URL] isFileURL]) {
-	    if(![[NSWorkspace sharedWorkspace] openFile:[[req URL] path]]){
-		[[dataSource webFrame] _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotFindApplicationForFile forURL:[req URL]];
-	    }
-	} else {
-	    if(![[NSWorkspace sharedWorkspace] openURL:[req URL]]){
-		[[dataSource webFrame] _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotFindApplicationForURL forURL:[req URL]];
-	    }
-	}
-
-	[self stopLoadingForPolicyChange];
-	return;
-	break;
-	
-    case WebPolicyRevealInFinder:
-	if (![[req URL] isFileURL]) {
-	    ERROR("contentPolicyForMIMEType:andRequest:inFrame: returned an invalid content policy.");
-	} else if (![[NSWorkspace sharedWorkspace] selectFile:[[req URL] path] inFileViewerRootedAtPath:@""]) {
-	    [[dataSource webFrame] _handleUnimplementablePolicyWithErrorCode:WebKitErrorFinderCannotOpenDirectory forURL:[req URL]];
-	}
-
-	[self stopLoadingForPolicyChange];
-	return;
-	break;
-    
     case WebPolicyIgnore:
 	[self stopLoadingForPolicyChange];
 	return;
diff --git a/WebKit/WebView.subproj/WebPolicyDelegate.h b/WebKit/WebView.subproj/WebPolicyDelegate.h
index de07d81..68a5769 100644
--- a/WebKit/WebView.subproj/WebPolicyDelegate.h
+++ b/WebKit/WebView.subproj/WebPolicyDelegate.h
@@ -45,26 +45,18 @@ extern NSString *WebActionOriginalURLKey; // NSURL
 /*!
     @enum WebPolicyAction
     @abstract Potential actions to take when loading a URL
-    @constant WebPolicyNone Unitialized state.
     @constant WebPolicyUse Have WebKit use the resource.
-    @constant WebPolicyRevealInFinder Reveal the file in the Finder.
     @constant WebPolicySave Save the resource to disk.
-    @constant WebPolicyOpenURL Open the URL in another application.
     @constant WebPolicyOpenNewWindow Open the resource in another window.
     @constant WebPolicyOpenNewWindowBehind Open the resource in another window behind this window.
     @constant WebPolicyIgnore Do nothing with the resource.
-    @constant WebPolicyShow Description forthcoming.
 */
 typedef enum {
-    WebPolicyNone,
     WebPolicyUse,
-    WebPolicyRevealInFinder,
     WebPolicySave,
-    WebPolicyOpenURL,
     WebPolicyOpenNewWindow,
     WebPolicyOpenNewWindowBehind,
     WebPolicyIgnore,
-    WebPolicyShow
 } WebPolicyAction;
 
 
@@ -82,15 +74,15 @@ typedef enum {
 
 
 /*!
-    @category WebControllerPolicyDelegate
-    @discussion While loading a URL, WebKit asks the WebControllerPolicyDelegate for
+    @category WebPolicyDelegate
+    @discussion While loading a URL, WebKit asks the WebPolicyDelegate for
     policies that determine the action of what to do with the URL or the data that
     the URL represents. Typically, the policy handler methods are called in this order:
 
     decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:<BR>
     contentPolicyForMIMEType:andRequest:inFrame:<BR>
 */
- at interface NSObject (WebControllerPolicyDelegate)
+ at interface NSObject (WebPolicyDelegate)
 
 /*!
      @method decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list