WebKit side of: <rdar://problem/3951283> can view pages from the back/forward cache...
authorcblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Jan 2005 19:30:09 +0000 (19:30 +0000)
committercblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Jan 2005 19:30:09 +0000 (19:30 +0000)
        Reviewed by john.

        * WebView.subproj/WebDefaultPolicyDelegate.m:
        (-[WebDefaultPolicyDelegate webView:shouldGoToHistoryItem:]): new private delegate method
        * WebView.subproj/WebFrame.m:
        (-[WebFrame _goToItem:withLoadType:]): call new delegate method
        * WebView.subproj/WebPolicyDelegatePrivate.h:

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

WebKit/ChangeLog
WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
WebKit/WebView.subproj/WebFrame.m
WebKit/WebView.subproj/WebPolicyDelegatePrivate.h

index 0ccdcf6ba4a51bd63536db571d0c256192c53a45..916dde0a3f19d6e07468dc70ded6759da70ba1a3 100644 (file)
@@ -1,3 +1,15 @@
+2005-01-28  Chris Blumenberg  <cblu@apple.com>
+
+       WebKit side of: <rdar://problem/3951283> can view pages from the back/forward cache that should be disallowed by Parental Controls
+
+        Reviewed by john.
+
+        * WebView.subproj/WebDefaultPolicyDelegate.m:
+        (-[WebDefaultPolicyDelegate webView:shouldGoToHistoryItem:]): new private delegate method
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame _goToItem:withLoadType:]): call new delegate method
+        * WebView.subproj/WebPolicyDelegatePrivate.h:
+
 2005-01-26  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Darin, Hyatt and Ken.
index e48fe660df66ba4cda9297556cb7b9d52f3ec9f8..99426fc3d8c74831388e44c4ed46b5e34fe1ec29 100644 (file)
@@ -83,5 +83,11 @@ static WebDefaultPolicyDelegate *sharedDelegate = nil;
     [listener use];
 }
 
+// Temporary SPI needed for <rdar://problem/3951283> can view pages from the back/forward cache that should be disallowed by Parental Controls
+- (BOOL)webView:(WebView *)webView shouldGoToHistoryItem:(WebHistoryItem *)item
+{
+    return YES;
+}
+
 @end
 
index a28198e3e99931220d4edc983bea0eb902497c44..d7c59cf5360d11d7b0b15a075238654a47ba8638 100644 (file)
@@ -1490,13 +1490,19 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 - (void)_goToItem: (WebHistoryItem *)item withLoadType: (WebFrameLoadType)type
 {
     ASSERT(!_private->parent);
-    WebBackForwardList *backForwardList = [[self webView] backForwardList];
-    WebHistoryItem *currItem = [backForwardList currentItem];
-    // Set the BF cursor before commit, which lets the user quickly click back/forward again.
-    // - plus, it only makes sense for the top level of the operation through the frametree,
-    // as opposed to happening for some/one of the page commits that might happen soon
-    [backForwardList goToItem:item];
-    [self _recursiveGoToItem:item fromItem:currItem withLoadType:type];
+    // shouldGoToHistoryItem is a private delegate method. This is needed to fix:
+    // <rdar://problem/3951283> can view pages from the back/forward cache that should be disallowed by Parental Controls
+    // Ultimately, history item navigations should go through the policy delegate. That's covered in:
+    // <rdar://problem/3979539> back/forward cache navigations should consult policy delegate
+    if ([[_private->webView _policyDelegateForwarder] webView:_private->webView shouldGoToHistoryItem:item]) {    
+        WebBackForwardList *backForwardList = [[self webView] backForwardList];
+        WebHistoryItem *currItem = [backForwardList currentItem];
+        // Set the BF cursor before commit, which lets the user quickly click back/forward again.
+        // - plus, it only makes sense for the top level of the operation through the frametree,
+        // as opposed to happening for some/one of the page commits that might happen soon
+        [backForwardList goToItem:item];
+        [self _recursiveGoToItem:item fromItem:currItem withLoadType:type];
+    }
 }
 
 - (void)_loadRequest:(NSURLRequest *)request triggeringAction:(NSDictionary *)action loadType:(WebFrameLoadType)loadType formState:(WebFormState *)formState
index dcea75ea06f7b834b2c479c240be5e8fe5bc9854..50f91736bcb25b6f85592d1c3e157b8a1a047792 100644 (file)
@@ -7,13 +7,14 @@
 #import <WebKit/WebPolicyDelegate.h>
 #import <WebKit/WebFormDelegate.h>
 
+@class WebHistoryItem;
+
 typedef enum {
     WebPolicyUse,
     WebPolicyDownload,
     WebPolicyIgnore,
 } WebPolicyAction;
 
-
 @class WebPolicyDecisionListenerPrivate;
 
 @interface WebPolicyDecisionListener : NSObject <WebPolicyDecisionListener, WebFormSubmissionListener>
@@ -27,3 +28,8 @@ typedef enum {
 - (void)_invalidate;
 
 @end
+
+@interface NSObject (WebPolicyDelegatePrivate)
+// Temporary SPI needed for <rdar://problem/3951283> can view pages from the back/forward cache that should be disallowed by Parental Controls
+- (BOOL)webView:(WebView *)webView shouldGoToHistoryItem:(WebHistoryItem *)item;
+@end