WebKit:
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Apr 2004 18:28:53 +0000 (18:28 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Apr 2004 18:28:53 +0000 (18:28 +0000)
        - fixed <rdar://problem/3622393>: When in stealth mode, visited webpage
        contents should not be cached to disk

        Reviewed by Ken.

        * WebView.subproj/WebBaseResourceHandleDelegate.m:
        (-[WebBaseResourceHandleDelegate willCacheResponse:]):
        if will cache to disk and in stealth mode, replace cache response with
        an identical one that won't cache to disk.

WebBrowser:

        - fixed the following bugs:
        <rdar://problem/3529727>: click and hold on an auto-tab folder in the bookmarks bar should show the items in a menu
        <rdar://problem/3546013>: bookmark button is left in the wrong state when closing a tab with bookmarks in it
        <rdar://problem/3612787>: When printed page has no HTML title, put URL in header instead of footer
        <rdar://problem/3628119>: Would like "Reveal in Collections" context menu item in bookmarks filter search results
        <rdar://problem/3628143>: Would like "Reveal in Collections" context menu item in Bookmarks bar

        Reviewed by Chris.

        * BookmarksViewController.m:
        (-[BookmarksViewController revealBookmark:expand:]):
        generalized this to work with content items that aren't bookmarks (e.g. history items)
        (-[BookmarksViewController outlineView:menuForEvent:inRow:tableColumn:]):
        add a "Reveal in Collections" item just before Delete
        (-[BookmarksViewController revealSelectedFilterSearchItem]):
        new method, sets the collection appropriately and then reveals the item

        * BrowserWebBookmarkExtras.m:
        (-[WebBookmark revealFavorite]):
        new method, calls through to BrowserWindowController

        * BrowserWebViewPrinting.m:
        (-[BrowserWebView webView:drawFooterInRect:]):
        don't draw URL in footer if it's already being drawn in the header

        * BrowserWindowController.h:
        * BrowserWindowController.m:
        (-[BrowserWindowController revealFavorite:]):
        new method, calls through to BookmarksViewController
        (-[BrowserWindowController closeTab:]):
        update the show/hide bookmarks button here also (we were already updating
        it when showing a tab)

        * English.lproj/Localizable.strings:
        updated for these changes

        * FavoriteButton.m:
        (-[FavoriteButton menu]):
        add "Reveal in Collections" item
        (-[FavoriteButton shouldShowContentsMenuFromEvent:waitedForDragDelay:]):
        added waitedForDragDelay parameter, use it to decide whether to show the
        menu even for the auto-tab case
        (-[FavoriteButton performClick:]):
        pass NO for waitedForDragDelay
        (-[FavoriteButton mouseDown:]):
        pass appropriate value for waitedForDragDelay

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

WebKit/ChangeLog
WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
WebKit/WebView.subproj/WebLoader.m

index f5039a2623e1004cda389483eb0db745bcca29d2..65bfacd7e0e92d0aa238b194fb6fe7564a30101c 100644 (file)
@@ -1,3 +1,15 @@
+2004-04-20  John Sullivan  <sullivan@apple.com>
+
+        - fixed <rdar://problem/3622393>: When in stealth mode, visited webpage 
+        contents should not be cached to disk
+
+        Reviewed by Ken.
+
+        * WebView.subproj/WebBaseResourceHandleDelegate.m:
+        (-[WebBaseResourceHandleDelegate willCacheResponse:]):
+        if will cache to disk and in stealth mode, replace cache response with
+        an identical one that won't cache to disk.
+
 2004-04-19  Ken Kocienda  <kocienda@apple.com>
 
         Reviewed by Hyatt
index 80a6ab503af78ad46c7c6240a96e55ef0238a9f2..383f0f0770eab78e89be9dca2824a866e18f2d36 100644 (file)
@@ -20,6 +20,8 @@
 #import <WebKit/WebDefaultResourceLoadDelegate.h>
 #import <WebKit/WebKitErrors.h>
 #import <WebKit/WebKitErrorsPrivate.h>
+#import <WebKit/WebPreferences.h>
+#import <WebKit/WebPreferencesPrivate.h>
 #import <WebKit/WebResourceLoadDelegate.h>
 #import <WebKit/WebResourcePrivate.h>
 #import <WebKit/WebViewPrivate.h>
 
 - (NSCachedURLResponse *)willCacheResponse:(NSCachedURLResponse *)cachedResponse
 {
+    // When in private browsing mode, prevent caching to disk
+    if ([cachedResponse storagePolicy] == NSURLCacheStorageAllowed && [[WebPreferences standardPreferences] privateBrowsingEnabled]) {
+        cachedResponse = [[[NSCachedURLResponse alloc] initWithResponse:[cachedResponse response]
+                                                                   data:[cachedResponse data]
+                                                               userInfo:[cachedResponse userInfo]
+                                                          storagePolicy:NSURLCacheStorageAllowedInMemoryOnly] autorelease];
+    }
     [self saveResourceWithCachedResponse:cachedResponse];
     return cachedResponse;
 }
index 80a6ab503af78ad46c7c6240a96e55ef0238a9f2..383f0f0770eab78e89be9dca2824a866e18f2d36 100644 (file)
@@ -20,6 +20,8 @@
 #import <WebKit/WebDefaultResourceLoadDelegate.h>
 #import <WebKit/WebKitErrors.h>
 #import <WebKit/WebKitErrorsPrivate.h>
+#import <WebKit/WebPreferences.h>
+#import <WebKit/WebPreferencesPrivate.h>
 #import <WebKit/WebResourceLoadDelegate.h>
 #import <WebKit/WebResourcePrivate.h>
 #import <WebKit/WebViewPrivate.h>
 
 - (NSCachedURLResponse *)willCacheResponse:(NSCachedURLResponse *)cachedResponse
 {
+    // When in private browsing mode, prevent caching to disk
+    if ([cachedResponse storagePolicy] == NSURLCacheStorageAllowed && [[WebPreferences standardPreferences] privateBrowsingEnabled]) {
+        cachedResponse = [[[NSCachedURLResponse alloc] initWithResponse:[cachedResponse response]
+                                                                   data:[cachedResponse data]
+                                                               userInfo:[cachedResponse userInfo]
+                                                          storagePolicy:NSURLCacheStorageAllowedInMemoryOnly] autorelease];
+    }
     [self saveResourceWithCachedResponse:cachedResponse];
     return cachedResponse;
 }