Closed Bug 392152 Opened 17 years ago Closed 17 years ago

Clear Private Data key combination doesn't clear downloads when DM is open (new DM)

Categories

(Toolkit :: Downloads API, defect)

defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla1.9beta1

People

(Reporter: scott001, Assigned: Gavin)

References

Details

(Keywords: regression)

Attachments

(2 files, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a8pre) Gecko/2007081305 Minefield/3.0a8pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a8pre) Gecko/2007081305 Minefield/3.0a8pre

When download manager is open, clearing private data (shift-ctrl-del) does not clear the download history until DM is closed.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
As a follow up to this, clear private data doesn't even work when the DM is focused.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a8pre) Gecko/2007081321 Minefield/3.0a8pre

When I close the Download Manager and reopen it, it is empty. You mean it should visibly erase the download history?
I see; confirmed. This is only about the key combination, not about the "Clear Private Data" menu option. They react differently.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Blocks: 388517
Summary: Clear Private Data doesn't clear downloads when DM is open (new DM) → Clear Private Data key combination doesn't clear downloads when DM is open (new DM)
Version: unspecified → Trunk
Are we really sure that this regressed from Bug 388517?  I don't think it did...
I just assumed, because it regressed only a few days ago, so I retested and it was indeed caused by Bug 388517.
Flags: in-litmus?
Flags: blocking-firefox3?
Scott, what's your value in about:config for privacy.item.downloads ?

If that pref is set to |true|, is the checkbox for "Download History" checked, but the menu item greyed out in "Tools | Clear Private Data"?
Actually, I wasn't completely understanding how this pref works.  It appears that the "Clear Private Data" dialog knows if we have download history, and then enables/disables the ability to toggle the checkbox for "Download History" based on that.  This actually wasn't working for me at first only because I had a stuck download (we can obviously only clear the "Completed" downloads, whether that be "Cancelled," "Failed," or "Done," etc...)

That said, I still see this failing with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a8pre) Gecko/2007090604 Minefield/3.0a8pre; I have two "Done" downloads, and when I pull up Clear Private Data, "Download History" is disabled, and so clicking on "Clear Private Data Now" does nothing.

Seems to me that the state of the downloads isn't being kept or passed to the Clear Private Data window correctly (or, not read).
Is this with the download manager window open?  I'd suspect that it doesn't remove things from an open window, but if you reopen it, it should work.
(In reply to comment #9)
> Is this with the download manager window open?  I'd suspect that it doesn't
> remove things from an open window, but if you reopen it, it should work.

Yes, and Scott said as much in comment 0.  I'm just particularly daft :( 

(In reply to comment #6)
> Scott, what's your value in about:config for privacy.item.downloads ?
> 
> If that pref is set to |true|, is the checkbox for "Download History" checked,
> but the menu item greyed out in "Tools | Clear Private Data"?
> 
Not in windows right now but I believe that value is for the privacy options, so it would have been set to true (I have everything set to true except for cookies as I clear them separately).

The only issue related to this bug is that the download clearing status is not updated until the DM is closed and re-opened (which can be somewhat of a privacy issue and also could make users believe it didn't work)... The secondary issue I had but never retested recently was the key combo not even working at all when DM is focused (key combo should still be passed).
Flags: blocking-firefox3? → blocking-firefox3+
Target Milestone: --- → Firefox 3 M10
Attached patch patch (obsolete) — Splinter Review
This is a bit hacky, because it makes the browser sanitize code depend on a function defined in the DM code in a non-obvious way, but it certainly is simple. We could alternatively use an observer topic, or something. I thought of having the DM notify the front-end via nsIDownloadManagerUI from it's CleanUp function, but the nsIDownloadManagerUI implementation isn't really any closer to the DM frontend code than sanitize.js is.
Assignee: nobody → gavin.sharp
Status: NEW → ASSIGNED
Attachment #282552 - Flags: review?(comrade693+bmo)
OS: Windows XP → All
Hardware: PC → All
Comment on attachment 282552 [details] [diff] [review]
patch

I'd honestly prefer to see an observer type thing go on so that add-ons can provide completely new UI and still work correctly.  This will work, but like you said, it's hacky.
Attachment #282552 - Attachment is obsolete: true
Attachment #282552 - Flags: review?(comrade693+bmo)
Attached patch observer service (obsolete) — Splinter Review
Should we also clear the "search" field?
Attachment #283014 - Flags: review?(comrade693+bmo)
Comment on attachment 283014 [details] [diff] [review]
observer service

>+
>+        // Clear the UI if there's an open DM window
>+        var obs = Components.classes["@mozilla.org/observer-service;1"].
>+                  getService(Components.interfaces.nsIObserverService);
>+        obs.notifyObservers(null, "download-manager-clear-history", "");
Hrm - shouldn't this be a part of the download manager api?  This way if some add-on calls the function, it updates the UI as well?

As for the search field, I wouldn't bother since that seems to have been removed with the latest mock-ups from the UX team.
(In reply to comment #16)
> Hrm - shouldn't this be a part of the download manager api?  This way if some
> add-on calls the function, it updates the UI as well?

You mean have the sanitize code call a DM method that notifies the front end code via the observer service?
It already calls the method - cleanup
Attached patch updatedSplinter Review
Attachment #283014 - Attachment is obsolete: true
Attachment #283076 - Flags: review?(comrade693+bmo)
Attachment #283014 - Flags: review?(comrade693+bmo)
Comment on attachment 283076 [details] [diff] [review]
updated

r=sdwilsh
Attachment #283076 - Flags: review?(comrade693+bmo) → review+
Target Milestone: Firefox 3 M10 → Firefox 3 M9
mozilla/toolkit/mozapps/downloads/content/downloads.js 	1.90
mozilla/toolkit/components/downloads/src/nsDownloadManager.cpp 	1.128
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Can you add some information to the download manager's idl stating that an observer topic is dispatched for cleanup please?  I forgot to mention that in my review.
rs=sdwilsh on the previously mentioned changed
mozilla/toolkit/components/downloads/public/nsIDownloadManager.idl 	1.21 
Blocks: 394039
Verified FIXED using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a9pre) Gecko/2007100505 Minefield/3.0a9pre and

Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a9pre) Gecko/2007100504 Minefield/3.0a9pre
Status: RESOLVED → VERIFIED
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: