Closed Bug 257281 Opened 21 years ago Closed 21 years ago

add browser reset functionality

Categories

(Camino Graveyard :: General, enhancement)

PowerPC
macOS
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Camino0.9

People

(Reporter: jaas, Assigned: mikepinkerton)

References

Details

Attachments

(1 file, 2 obsolete files)

16.01 KB, application/octet-stream
mikepinkerton
: superreview+
Details
A nice addition to Camino's privacy tools would be reset browser functionality. Browser reset should remove cookies, cache, site prefs, history, saved usernames and passwords, and downloads.
Attached file reset browser patch v1.0 (obsolete) —
Includes a patch, a modified main menu nib file to add the menu item, and a modified Localizable.strings.
Attachment #157286 - Flags: review?(me)
Target Milestone: --- → Camino0.9
(In reply to comment #1) > Created an attachment (id=157286) > reset browser patch v1.0 > > Includes a patch, a modified main menu nib file to add the menu item, and a > modified Localizable.strings. This looks good and works as stated. It seems that it would be a good idea (though this should probably be a separate patch and a separate bug) to use EvictEntries(nsICache::STORE_ANYWHERE) instead of just STORE_ON_DISK so that the entire cache is cleared, including the RAM cache. Since I don't have permission to edit the flag: r=me@mollyandgeoff.com
To clarify... nsICache::STORE_ON_DISK is used in the current pref pane to clear cache, and that is why it is used in my patch. If the correct thing to do is use nsICache::STORE_ANYWHERE, then that it a separate issue and must be resolved in the pref pane and my patch.
Attachment #157286 - Flags: review?(me) → superreview?(pinkerton)
Attachment #157286 - Flags: review?(me)
Attachment #157286 - Flags: review?(me) → review+
Comment on attachment 157286 [details] reset browser patch v1.0 > +- (IBAction)resetBrowser:(id)sender { put brace on new line > + int i; > + > + // close all windows > + NSArray *windows = [NSApp orderedWindows]; > + for (i = 0; i < [windows count]; i++) { for (int i = 0; ....) > + if (mPermissionManager) { > + mPermissionManager->RemoveAll(); > + } lose the braces on loops/conditionals that only have 1 statement. > + nsCOMPtr<nsICookieManager> cm(do_GetService(NS_COOKIEMANAGER_CONTRACTID)); > + nsICookieManager* mCookieManager = cm.get(); > + NS_IF_ADDREF(mCookieManager); > + if (mCookieManager) { > + mCookieManager->RemoveAll(); > + } > + NS_IF_RELEASE(mCookieManager); why are you doing an additional addref/release? that's what the comPtr does. you can remove those entirely. > + kcfindinternetpassword(NULL, NULL, NULL, kAnyPort, kKCProtocolTypeHTTP, kKCAuthTypeHTTPDigest, > + kBufferLen, buffer, &actualSize, &itemRef); > + while (itemRef) { > + KCDeleteItem(itemRef); > + itemRef = NULL; > + kcfindinternetpassword(NULL, NULL, NULL, kAnyPort, kKCProtocolTypeHTTP, kKCAuthTypeHTTPDigest, > + kBufferLen, buffer, &actualSize, &itemRef); > + } i don't really like loops that duplicate code like this...how about using a bool flag instead that you prime with true to get started and set to false when |itemRef| is nil? > + for (int i = 0; i < [mProgressViewControllers count]; i++) { > + // the ProgressViewController method "cancel:" has a sanity check, so its ok to call on anything > + // make sure downloads are not active before removing them > + [[mProgressViewControllers objectAtIndex:i] cancel:self]; > + [self removeDownload:[mProgressViewControllers objectAtIndex:i]]; // remove the download > + i--; // leave index at the same position because the dl there got removed > + } you decrement |i| and then increment it. why bother? why not just not increment it?
Attachment #157286 - Flags: superreview?(pinkerton) → superreview-
Attached file reset browser patch v2.0 (obsolete) —
This new patch fixes everything mentioned in Mike's comments, changes cache clearing flag to STORED_ANYWHERE, and makes the alert panel a critical alert panel instead of just a normal one.
Attachment #157286 - Attachment is obsolete: true
Attachment #157449 - Flags: superreview?(pinkerton)
Attachment #157449 - Flags: review?(me)
Comment on attachment 157449 [details] reset browser patch v2.0 This patch appears to address Mike's concerns, and works as described. r=me@mollyandgeoff.com
Attachment #157449 - Flags: review?(me) → review+
I have opened Bug 257491 to address the policy flag for EvictEntries().
No longer blocks: 257491
*** Bug 172063 has been marked as a duplicate of this bug. ***
Comment on attachment 157449 [details] reset browser patch v2.0 A few things: - doesn't compile (stray brace) - in the alert, the cancel button should be on the left and the default, not on the right. That's the format of the "are you sure?" dialog. - The title text should be more explanatory, something more than "reset camino" - the secondary explanatory text should mention that this is not undoable
Attachment #157449 - Flags: superreview?(pinkerton) → superreview-
I'll take care of that stuff ASAP.
Mike - the problem with using NSAlert on 10.3 and the alert panel function on panther is that since we compile against the 10.2.8 SDK there is no NSAlert object to compile against. Its OK to call a method that might not exist, but we can't refer to objects that don't exist in the SDK. That means we have 2 options: - write the warning panel from scratch (bad) - use the existing appkit function as in v2.0 of the patch (not as bad) The latter option means the button order will the the reverse of what you want, but I don't think its a big enough deal to warrant writing this panel from scratch.
This version of the patch fixes problems in v2.0 and resolve the button naming argument per an IRC conversation with Pinkerton and others yesterday. The patch files have also been updated to apply cleanly to today's code (e.g. takes into account yesterday's Localizable.strings changes).
Attachment #157449 - Attachment is obsolete: true
Attachment #161532 - Flags: review?(me)
Attachment #161532 - Flags: superreview?(pinkerton)
(In reply to comment #12) > This version of the patch fixes problems in v2.0 and resolve the button naming > argument per an IRC conversation with Pinkerton and others yesterday. The patch > files have also been updated to apply cleanly to today's code (e.g. takes into > account yesterday's Localizable.strings changes). I missed the IRC conversation yesterday, and the content wasn't posted here so I can't be sure... but the patch now has cancel on the left, with the destructive option as the default. Is having the destructive item for the default intentional? If so, r=me@mollyandgeoff.com. Destroys data as advertised.
I just noticed this patch doesn't clear the number of visits stats kept for bookmarks. To be complete, should it do that? (maybe not, but thought i'd ask)
I don't think it should. I think we should leave bookmarks alone. The IRC conversation basically came down to looking at Mail and some other Apple apps where the destructive option (e.g. deleting a Mail.app mailbox) is default as it is in the new patch. You're already getting a warning, which is the point of the dialog box in the first place.
Attachment #161532 - Flags: review?(me) → review+
so that begs the question, how does someone clear the bookmark visits easily? should we provide some ui? also, do we want to provide a separate menu item to just clear cache?
Comment on attachment 161532 [details] reset browser patch v3.0 +- (void)removeAllUsernamesAndPasswords { put the brace on a separate line. make sure when you land this, you correctly merge the localized.strings file. I'm pretty sure it's changed since this patch got going. sr=pink
Attachment #161532 - Flags: superreview?(pinkerton) → superreview+
landed
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: