Closed Bug 524345 Opened 15 years ago Closed 15 years ago

Port Bug 461634 [new API: allow to delete a single closed tab] to SeaMonkey

Categories

(SeaMonkey :: Session Restore, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.1a1

People

(Reporter: misak.bugzilla, Assigned: misak.bugzilla)

References

Details

Attachments

(1 file, 3 obsolete files)

From parent bug:

Extensions desiring to selectively forget information about closed tabs/windows
have to be quite inventive. What about a new API:

void forgetClosedTab(in nsIDOMWindow aWindow, in unsigned long aIndex);
Attached patch patch (obsolete) — Splinter Review
Patch with test. I disabled some of tests related to our specific implementation of undCloseTab and bug 478707. Rest of tests passing.
Attachment #409308 - Flags: superreview?(neil)
Attachment #409308 - Flags: review?(neil)
Comment on attachment 409308 [details] [diff] [review]
patch

I don't think this relates to our version of undoCloseTab.
Attachment #409308 - Flags: superreview?(neil)
Attachment #409308 - Flags: superreview-
Attachment #409308 - Flags: review?(neil)
Sorry, i just mean that because of our specific implementation of undoCloseTab, bug 478707 exist, and we have little mess with getClosedTabData. We don't restore closed tab data or save it when setWindowState called. That's why disabled test fail.
Right, but this API is to forget about the closed tab of an open window, and we currently track that on the tabbrowser instead. At least from our point of view, it would make more sense to provide the API on the tabbrowser too, and it would simply destroy the saved browser in much the same way as the code at the end of removeTab destroys the oldest saved browser if it overflows the undo stack.
Depends on: 478707
Attached patch suggestion implemented. (obsolete) — Splinter Review
Done as Neil suggested. Also i replaced gBrowser by getBrowser(). Test is almost useless now, it only check for wrong parameters, until bug 478707 will be fixed.
Attachment #409308 - Attachment is obsolete: true
Attachment #409676 - Flags: superreview?(neil)
Attachment #409676 - Flags: review?(neil)
Comment on attachment 409676 [details] [diff] [review]
suggestion implemented.

>+      <method name="forgetSavedBrowser">
I wonder whether Firefox would be interested in an API on tabbrowser.

>+        <parameter name="aIndex"/>
Need to validate aIndex here, in case anyone calls it directly.

>+    aIndex = aIndex || 0;
Don't need this, XPConnect already defaults to 0. (And you'll be validating in the tabbrowser anyway, right?)

>+    ss.setWindowState(newWin, JSON.stringify(test_state), true);
Maybe we can add and close tabs directly, thus simulating closed tabs?
Attached patch comments fixed. (obsolete) — Splinter Review
Well, all done as suggested. Tests all enabled and passing.
Attachment #409676 - Attachment is obsolete: true
Attachment #409893 - Flags: superreview?(neil)
Attachment #409893 - Flags: review?(neil)
Attachment #409676 - Flags: superreview?(neil)
Attachment #409676 - Flags: review?(neil)
Attachment #409893 - Flags: superreview?(neil)
Attachment #409893 - Flags: superreview+
Attachment #409893 - Flags: review?(neil)
Attachment #409893 - Flags: review+
Comment on attachment 409893 [details] [diff] [review]
comments fixed.

Warning: 9 lines add whitespace errors.

>diff --git a/suite/common/src/nsSessionStore.js b/suite/common/src/nsSessionStore.js
>--- a/suite/common/src/nsSessionStore.js
>+++ b/suite/common/src/nsSessionStore.js
>@@ -23,6 +23,7 @@
>  *   Ehsan Akhgari <ehsan.akhgari@gmail.com>
>  *   Paul OâShannessy <paul@oshannessy.com>
>  *   Nils Maier <maierman@web.de>
>+ *   Michael Kraft <morac99-firefox@yahoo.com>
In this file, the changes are all yours :-)

>+	"... and tabs not specifically forgetten weren't.");
Nit: forgotten
patch for checkin, carrying forward r+ and sr+ from Neil.
Attachment #409893 - Attachment is obsolete: true
Attachment #410720 - Flags: superreview+
Attachment #410720 - Flags: review+
Keywords: checkin-needed
Comment on attachment 410720 [details] [diff] [review]
for checkin
[Checkin: Comment 10]


http://hg.mozilla.org/comm-central/rev/401efe3c7c6a
Attachment #410720 - Attachment description: for checkin → for checkin [Checkin: Comment 10]
Keywords: checkin-needed
Target Milestone: --- → seamonkey2.1a1
Flags: in-testsuite+
I guess we can close this bug.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Blocks: 567531
You need to log in before you can comment on or make changes to this bug.