WebKit:
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Mar 2004 22:16:19 +0000 (22:16 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Mar 2004 22:16:19 +0000 (22:16 +0000)
        - some support for "Stealth Browsing"; add a preference that
        controls whether a history item is added when a page is visited.
        This is called "historyIsFrozen" for now, but I wouldn't be
        surprised to see this name change.

        Reviewed by Dave.

        * WebView.subproj/WebPreferencesPrivate.h:
        new historyIsFrozen, setHistoryIsFrozen: methods

        * WebView.subproj/WebPreferences.m:
        new WebKitHistoryIsFrozenPreferenceKey
        (+[WebPreferences initialize]):
        set initial value of WebKitHistoryIsFrozenPreferenceKey
        (-[WebPreferences setHistoryIsFrozen:]):
        set value of WebKitHistoryIsFrozenPreferenceKey
        (-[WebPreferences historyIsFrozen]):
        read value of WebKitHistoryIsFrozenPreferenceKey

        * WebView.subproj/WebFrame.m:
        (-[WebFrame _transitionToCommitted:]):
        don't add item to history if history is frozen

WebBrowser:

        A little progress on "Stealth Mode"

        Reviewed by Dave.

        * AppController.m:
        (-[AppController toggleStealthMode:]):
        replace use of StealthModePreferenceKey with new WebPreferences SPI call
        (-[AppController validateUserInterfaceItem:]):
        ditto

        * PreferenceKeys.h:
        remove StealthModePreferenceKey

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

WebKit/ChangeLog
WebKit/WebView.subproj/WebFrame.m
WebKit/WebView.subproj/WebPreferences.m
WebKit/WebView.subproj/WebPreferencesPrivate.h

index 55a3c00a8b76946d6d20fce6afe9071a4d845ccc..6846a2683971901c027740cbe8577e799b8353be 100644 (file)
@@ -1,3 +1,28 @@
+2004-03-29  John Sullivan  <sullivan@apple.com>
+
+        - some support for "Stealth Browsing"; add a preference that
+        controls whether a history item is added when a page is visited.
+        This is called "historyIsFrozen" for now, but I wouldn't be
+        surprised to see this name change.
+
+        Reviewed by Dave.
+
+        * WebView.subproj/WebPreferencesPrivate.h:
+        new historyIsFrozen, setHistoryIsFrozen: methods
+        
+        * WebView.subproj/WebPreferences.m:
+        new WebKitHistoryIsFrozenPreferenceKey
+        (+[WebPreferences initialize]):
+        set initial value of WebKitHistoryIsFrozenPreferenceKey
+        (-[WebPreferences setHistoryIsFrozen:]):
+        set value of WebKitHistoryIsFrozenPreferenceKey
+        (-[WebPreferences historyIsFrozen]):
+        read value of WebKitHistoryIsFrozenPreferenceKey
+
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame _transitionToCommitted:]):
+        don't add item to history if history is frozen
+
 2004-03-29  Darin Adler  <darin@apple.com>
 
         Reviewed by John.
index 0e3ec7aa95d7bf1ffbaba40bcb32d3c46f206237..240ae901a9a99c2acd92bffb96901ad55ca9f852 100644 (file)
@@ -791,9 +791,11 @@ NSString *WebPageCacheDocumentViewKey = @"WebPageCacheDocumentViewKey";
                     // Add item to history and BF list
                     NSURL *URL = [ds _URLForHistory];
                     if (URL && ![URL _web_isEmpty]){
-                        entry = [[WebHistory optionalSharedHistory] addItemForURL:URL];
-                        if (ptitle)
-                            [entry setTitle: ptitle];
+                        if (![[WebPreferences standardPreferences] historyIsFrozen]) {
+                            entry = [[WebHistory optionalSharedHistory] addItemForURL:URL];
+                            if (ptitle)
+                                [entry setTitle: ptitle];                            
+                        }
                         [self _addBackForwardItemClippedAtTarget:YES];
                     }
 
index 5d7d50ab8f5ea25d4a9991a446feda1a887e53bd..249903a551eaa1b19a74a0eeaae4feb01578f12e 100644 (file)
@@ -46,6 +46,7 @@
 #define WebKitObjectCacheSizePreferenceKey @"WebKitObjectCacheSizePreferenceKey"
 #define WebKitBackForwardCacheExpirationIntervalKey @"WebKitBackForwardCacheExpirationIntervalKey"
 #define WebKitTabToLinksPreferenceKey @"WebKitTabToLinksPreferenceKey"
+#define WebKitHistoryIsFrozenPreferenceKey @"WebKitHistoryIsFrozen"
 
 NSString *WebPreferencesChangedNotification = @"WebPreferencesChangedNotification";
 
@@ -234,6 +235,7 @@ NS_ENDHANDLER
         [NSNumber numberWithBool:YES],  WebKitDisplayImagesKey,
         @"1800",                        WebKitBackForwardCacheExpirationIntervalKey,
         [NSNumber numberWithBool:NO],   WebKitTabToLinksPreferenceKey,
+        [NSNumber numberWithBool:NO],   WebKitHistoryIsFrozenPreferenceKey,
         nil];
 
     [[NSUserDefaults standardUserDefaults] registerDefaults:dict];
@@ -608,6 +610,16 @@ NS_ENDHANDLER
     return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitTabToLinksPreferenceKey];
 }
 
+- (void)setHistoryIsFrozen:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitHistoryIsFrozenPreferenceKey];
+}
+
+- (BOOL)historyIsFrozen
+{
+    return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitHistoryIsFrozenPreferenceKey];
+}
+
 static NSMutableDictionary *webPreferencesInstances = nil;
 
 + (WebPreferences *)_getInstanceForIdentifier:(NSString *)ident
index 48f1cad53c462a8b50b5ce06d856ffa1a0ae8ab0..3876c1e8434c6570dc5c9b448054da2167048175 100644 (file)
@@ -22,6 +22,9 @@
 
 + (void)_setIBCreatorID:(NSString *)string;
 
+- (void)setHistoryIsFrozen:(BOOL)newValue;
+- (BOOL)historyIsFrozen;
+
 - (void)setTabsToLinks:(BOOL)flag;
 - (BOOL)tabsToLinks;