mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 02:57:38 +00:00
Bug 827298 - Ensure all "Unknown size" downloads have an icon and Remove From History menuitem.
r=Mano
This commit is contained in:
parent
28a68bbaad
commit
8ce6ba810e
@ -13,12 +13,12 @@ richlistitem.download {
|
||||
.download-state:not(:-moz-any([state="2"], /* Failed */
|
||||
[state="4"]) /* Paused */)
|
||||
.downloadCancelMenuItem,
|
||||
.download-state:not(:-moz-any([state="1"], /* Finished */
|
||||
[state="2"], /* Failed */
|
||||
[state="3"], /* Canceled */
|
||||
[state="6"], /* Blocked (parental) */
|
||||
[state="8"], /* Blocked (dirty) */
|
||||
[state="9"]) /* Blocked (policy) */)
|
||||
.download-state[state]:not(:-moz-any([state="1"], /* Finished */
|
||||
[state="2"], /* Failed */
|
||||
[state="3"], /* Canceled */
|
||||
[state="6"], /* Blocked (parental) */
|
||||
[state="8"], /* Blocked (dirty) */
|
||||
[state="9"]) /* Blocked (policy) */)
|
||||
.downloadRemoveFromHistoryMenuItem,
|
||||
.download-state:not(:-moz-any([state="-1"],/* Starting (initial) */
|
||||
[state="0"], /* Downloading */
|
||||
@ -26,8 +26,7 @@ richlistitem.download {
|
||||
[state="4"], /* Paused */
|
||||
[state="5"]) /* Starting (queued) */)
|
||||
.downloadShowMenuItem,
|
||||
.download-state[state="7"] .downloadCommandsSeparator,
|
||||
.download-state:not([state]) .downloadCommandsSeparator
|
||||
.download-state[state="7"] .downloadCommandsSeparator
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
@ -154,8 +154,13 @@ DownloadElementShell.prototype = {
|
||||
get _icon() {
|
||||
if (this._targetFileURI)
|
||||
return "moz-icon://" + this._targetFileURI + "?size=32";
|
||||
if (this._placesNode)
|
||||
return this.placesNode.icon;
|
||||
if (this._placesNode) {
|
||||
// Try to extract an extension from the uri.
|
||||
let ext = this._downloadURIObj.QueryInterface(Ci.nsIURL).fileExtension;
|
||||
if (ext)
|
||||
return "moz-icon://." + ext + "?size=32";
|
||||
return this._placesNode.icon || "moz-icon://.unknown?size=32";
|
||||
}
|
||||
if (this._dataItem)
|
||||
throw new Error("Session-download items should always have a target file uri");
|
||||
throw new Error("Unexpected download element state");
|
||||
|
Loading…
Reference in New Issue
Block a user