Reviewed by Darin.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Oct 2006 06:46:15 +0000 (06:46 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Oct 2006 06:46:15 +0000 (06:46 +0000)
        - pass remaining delegate methods across client interface

        * Loader/WebFrameLoader.m:
        (-[WebFrameLoader _checkContentPolicyForMIMEType:andCall:withSelector:]):
        (-[WebFrameLoader checkNewWindowPolicyForRequest:action:frameName:formState:andCall:withSelector:]):
        (-[WebFrameLoader checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]):
        (-[WebFrameLoader handleUnimplementablePolicyWithErrorCode:forURL:]):
        (-[WebFrameLoader didFirstLayout]):
        (-[WebFrameLoader continueLoadRequestAfterNewWindowPolicy:frameName:formState:]):
        * Loader/WebFrameLoaderClient.h:
        * WebView/WebFrame.m:
        (-[WebFrame _dispatchDidFirstLayoutInFrame]):
        (-[WebFrame _dispatchCreateWebViewWithRequest:]):
        (-[WebFrame _dispatchShow]):
        (-[WebFrame _dispatchDecidePolicyForMIMEType:request:decisionListener:]):
        (-[WebFrame _dispatchDecidePolicyForNewWindowAction:request:newFrameName:decisionListener:]):
        (-[WebFrame _dispatchDecidePolicyForNavigationAction:request:decisionListener:]):
        (-[WebFrame _dispatchUnableToImplementPolicyWithError:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16915 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/Loader/WebFrameLoader.m
WebKit/Loader/WebFrameLoaderClient.h
WebKit/WebView/WebFrame.m

index 331e24a393827c1122795fd0d5c333da9453dee9..e92340e1e8a828ceb618b25f94da1b02cad5ae8d 100644 (file)
@@ -1,3 +1,26 @@
+2006-10-08  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Darin.
+        
+        - pass remaining delegate methods across client interface
+
+        * Loader/WebFrameLoader.m:
+        (-[WebFrameLoader _checkContentPolicyForMIMEType:andCall:withSelector:]):
+        (-[WebFrameLoader checkNewWindowPolicyForRequest:action:frameName:formState:andCall:withSelector:]):
+        (-[WebFrameLoader checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]):
+        (-[WebFrameLoader handleUnimplementablePolicyWithErrorCode:forURL:]):
+        (-[WebFrameLoader didFirstLayout]):
+        (-[WebFrameLoader continueLoadRequestAfterNewWindowPolicy:frameName:formState:]):
+        * Loader/WebFrameLoaderClient.h:
+        * WebView/WebFrame.m:
+        (-[WebFrame _dispatchDidFirstLayoutInFrame]):
+        (-[WebFrame _dispatchCreateWebViewWithRequest:]):
+        (-[WebFrame _dispatchShow]):
+        (-[WebFrame _dispatchDecidePolicyForMIMEType:request:decisionListener:]):
+        (-[WebFrame _dispatchDecidePolicyForNewWindowAction:request:newFrameName:decisionListener:]):
+        (-[WebFrame _dispatchDecidePolicyForNavigationAction:request:decisionListener:]):
+        (-[WebFrame _dispatchUnableToImplementPolicyWithError:]):
+
 2006-10-08  Darin Adler  <darin@apple.com>
 
         Reviewed by Maciej.
index 4f3bb3cc3b55e7d4a40f4dabedb0d1fa94e0eaa2..f06eee277a5de4af9454dfb063a3efd177b462ad 100644 (file)
@@ -39,7 +39,6 @@
 #import <WebCore/WebCoreSystemInterface.h>
 
 #import "WebDataSourceInternal.h"
-#import "WebDefaultUIDelegate.h"
 #import "WebDocumentLoaderMac.h"
 #import "WebFrameInternal.h"
 #import "WebFrameViewInternal.h"
@@ -51,7 +50,6 @@
 #import "WebNSURLRequestExtras.h"
 #import "WebResourcePrivate.h"
 #import "WebScriptDebugServerPrivate.h"
-#import "WebUIDelegate.h"
 #import "WebViewInternal.h"
 
 @implementation WebFrameLoader
@@ -1078,10 +1076,8 @@ static BOOL isCaseInsensitiveEqual(NSString *a, NSString *b)
     
     [l retain];
 
-    [[[client webView] _policyDelegateForwarder] webView:[client webView] decidePolicyForMIMEType:MIMEType
-                                                 request:[[self activeDocumentLoader] request]
-                                                   frame:client
-                                        decisionListener:listener];
+    [client _dispatchDecidePolicyForMIMEType:MIMEType request:[[self activeDocumentLoader] request] decisionListener:listener];
+
     [l release];
 }
 
@@ -1377,12 +1373,7 @@ BOOL isBackForwardLoadType(FrameLoadType type)
     listener = [decisionListener retain];
     policyFormState = [formState retain];
 
-    WebView *wv = [client webView];
-    [[wv _policyDelegateForwarder] webView:wv
-            decidePolicyForNewWindowAction:action
-                                   request:request
-                              newFrameName:frameName
-                          decisionListener:decisionListener];
+    [client _dispatchDecidePolicyForNewWindowAction:action request:request newFrameName:frameName decisionListener:decisionListener];
     
     [decisionListener release];
 }
@@ -1460,13 +1451,8 @@ BOOL isBackForwardLoadType(FrameLoadType type)
     ASSERT(policyFormState == nil);
     policyFormState = [formState retain];
 
-    WebView *wv = [client webView];
     delegateIsDecidingNavigationPolicy = YES;
-    [[wv _policyDelegateForwarder] webView:wv
-           decidePolicyForNavigationAction:action
-                                   request:request
-                                     frame:client
-                          decisionListener:decisionListener];
+    [client _dispatchDecidePolicyForNavigationAction:action request:request decisionListener:decisionListener];
     delegateIsDecidingNavigationPolicy = NO;
     
     [decisionListener release];
@@ -1613,9 +1599,8 @@ BOOL isBackForwardLoadType(FrameLoadType type)
 - (void)handleUnimplementablePolicyWithErrorCode:(int)code forURL:(NSURL *)URL
 {
     NSError *error = [NSError _webKitErrorWithDomain:WebKitErrorDomain code:code URL:URL];
-    WebView *wv = [client webView];
     delegateIsHandlingUnimplementablePolicy = YES;
-    [[wv _policyDelegateForwarder] webView:wv unableToImplementPolicyWithError:error frame:client];    
+    [client _dispatchUnableToImplementPolicyWithError:error];
     delegateIsHandlingUnimplementablePolicy = NO;
 }
 
@@ -1627,9 +1612,7 @@ BOOL isBackForwardLoadType(FrameLoadType type)
     }
 
     firstLayoutDone = YES;
-
-    WebView *wv = [client webView];
-    [[wv _frameLoadDelegateForwarder] webView:wv didFirstLayoutInFrame:client];
+    [client _dispatchDidFirstLayoutInFrame];
 }
 
 - (void)frameLoadCompleted
@@ -1881,17 +1864,7 @@ keepGoing:
     WebFrameBridge *bridge = [self bridge];
     [bridge retain];
 
-    WebView *webView = nil;
-    WebView *currentWebView = [client webView];
-    id wd = [currentWebView UIDelegate];
-    if ([wd respondsToSelector:@selector(webView:createWebViewWithRequest:)])
-        webView = [wd webView:currentWebView createWebViewWithRequest:nil];
-    else
-        webView = [[WebDefaultUIDelegate sharedUIDelegate] webView:currentWebView createWebViewWithRequest:nil];
-    if (!webView)
-        goto exit;
-
-    WebFrame *mainFrame = [webView mainFrame];
+    WebFrame *mainFrame = [client _dispatchCreateWebViewWithRequest:nil];
     if (!mainFrame)
         goto exit;
 
@@ -1900,7 +1873,7 @@ keepGoing:
 
     [mainBridge setName:frameName];
 
-    [[webView _UIDelegateForwarder] webViewShow:webView];
+    [mainFrame _dispatchShow];
 
     [mainBridge setOpener:bridge];
     [[mainFrame _frameLoader] _loadRequest:request triggeringAction:nil loadType:WebFrameLoadTypeStandard formState:formState];
index 1c29badc226b260dc93bd7015176478db580186a..1de32fe4991e5aba0223eb5910497041ec2b7669 100644 (file)
@@ -31,6 +31,7 @@
 typedef struct LoadErrorResetToken LoadErrorResetToken;
 
 @class WebDocumentLoader;
+@class WebPolicyDecisionListener;
 @protocol WebFrameLoaderClient
 
 - (void)_resetBackForwardList;
@@ -87,6 +88,14 @@ typedef struct LoadErrorResetToken LoadErrorResetToken;
 - (void)_dispatchDidFailProvisionalLoadWithError:(NSError *)error;
 - (void)_dispatchDidFailLoadWithError:(NSError *)error;
 - (void)_dispatchDidFinishLoadForFrame;
+- (void)_dispatchDidFirstLayoutInFrame;
 
+- (WebFrame *)_dispatchCreateWebViewWithRequest:(NSURLRequest *)request;
+- (void)_dispatchShow;
+
+- (void)_dispatchDecidePolicyForMIMEType:(NSString *)MIMEType request:(NSURLRequest *)request decisionListener:(WebPolicyDecisionListener *)decisionListener;
+- (void)_dispatchDecidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)frameName decisionListener:(WebPolicyDecisionListener *)decisionListener;
+- (void)_dispatchDecidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request decisionListener:(WebPolicyDecisionListener *)decisionListener;
+- (void)_dispatchUnableToImplementPolicyWithError:(NSError *)error;
 
 @end
index e1dec1aa838cc93e234b28ed02b35cc85daa3e2a..d6279d6e14e91f31327306c4768a4e17a0c778a0 100644 (file)
@@ -1758,6 +1758,61 @@ static inline WebDataSource *dataSource(WebDocumentLoader *loader)
     [[webView _frameLoadDelegateForwarder] webView:webView didFinishLoadForFrame:self];
 }
 
+- (void)_dispatchDidFirstLayoutInFrame
+{
+    WebView *webView = [self webView];
+    [[webView _frameLoadDelegateForwarder] webView:webView didFirstLayoutInFrame:self];
+}
+
+- (WebFrame *)_dispatchCreateWebViewWithRequest:(NSURLRequest *)request
+{
+    WebView *currentWebView = [self webView];
+    id wd = [currentWebView UIDelegate];
+    if ([wd respondsToSelector:@selector(webView:createWebViewWithRequest:)])
+        return [[wd webView:currentWebView createWebViewWithRequest:request] mainFrame];
+
+    return [[[WebDefaultUIDelegate sharedUIDelegate] webView:currentWebView createWebViewWithRequest:request] mainFrame];
+}
+
+- (void)_dispatchShow
+{
+    WebView *webView = [self webView];
+    [[webView _UIDelegateForwarder] webViewShow:webView];
+}
+
+- (void)_dispatchDecidePolicyForMIMEType:(NSString *)MIMEType request:(NSURLRequest *)request decisionListener:(WebPolicyDecisionListener *)decisionListener
+{
+    WebView *webView = [self webView];
+
+    [[webView _policyDelegateForwarder] webView:webView decidePolicyForMIMEType:MIMEType request:request frame:self decisionListener:decisionListener];
+}
+
+- (void)_dispatchDecidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)frameName decisionListener:(WebPolicyDecisionListener *)decisionListener
+{
+    WebView *webView = [self webView];
+    [[webView _policyDelegateForwarder] webView:webView
+            decidePolicyForNewWindowAction:action
+                                   request:request
+                              newFrameName:frameName
+                          decisionListener:decisionListener];
+}
+
+- (void)_dispatchDecidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request decisionListener:(WebPolicyDecisionListener *)decisionListener
+{
+    WebView *webView = [self webView];
+    [[webView _policyDelegateForwarder] webView:webView
+                decidePolicyForNavigationAction:action
+                                        request:request
+                                          frame:self
+                               decisionListener:decisionListener];
+}
+
+- (void)_dispatchUnableToImplementPolicyWithError:(NSError *)error
+{
+    WebView *webView = [self webView];
+    [[webView _policyDelegateForwarder] webView:webView unableToImplementPolicyWithError:error frame:self];    
+}
+
 - (void)_detachedFromParent1
 {
     [self _saveScrollPositionAndViewStateToItem:_private->currentItem];