Bug 1198181 - Part 3 - Showing the unblock dialog should be the visible action for verdicts other than malware. r=past
MozReview-Commit-ID: GJNojR8L3Mx
--- a/browser/components/downloads/DownloadsViewUI.jsm
+++ b/browser/components/downloads/DownloadsViewUI.jsm
@@ -107,16 +107,24 @@ this.DownloadsViewUI.DownloadElementShel
* update in order to improve performance.
*/
_updateState() {
this.element.setAttribute("displayName", this.displayName);
this.element.setAttribute("image", this.image);
this.element.setAttribute("state",
DownloadsCommon.stateOfDownload(this.download));
+ if (this.download.error &&
+ this.download.error.becauseBlockedByReputationCheck) {
+ this.element.setAttribute("verdict",
+ this.download.error.reputationCheckVerdict);
+ } else {
+ this.element.removeAttribute("verdict");
+ }
+
// Since state changed, reset the time left estimation.
this.lastEstimatedSecondsLeft = Infinity;
this._updateProgress();
},
/**
* Updates the elements that change regularly for in-progress downloads,
--- a/browser/components/downloads/content/download.xml
+++ b/browser/components/downloads/content/download.xml
@@ -58,16 +58,19 @@
tooltiptext="&cmd.showMac.label;"
#else
tooltiptext="&cmd.show.label;"
#endif
oncommand="DownloadsView.onDownloadCommand(event, 'downloadsCmd_show');"/>
<xul:button class="downloadButton downloadConfirmBlock downloadIconCancel"
tooltiptext="&cmd.removeFile.label;"
oncommand="DownloadsView.onDownloadCommand(event, 'downloadsCmd_confirmBlock');"/>
+ <xul:button class="downloadButton downloadUnblock downloadIconShow"
+ tooltiptext="&cmd.unblock.label;"
+ oncommand="DownloadsView.onDownloadCommand(event, 'downloadsCmd_unblock');"/>
</xul:stack>
</content>
</binding>
<binding id="download-toolbarbutton"
extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton">
<content>
<children />
--- a/browser/components/downloads/content/downloads.css
+++ b/browser/components/downloads/content/downloads.css
@@ -113,21 +113,32 @@ richlistitem.download button {
.download-state:not(:-moz-any([state="-1"],/* Starting (initial) */
[state="5"], /* Starting (queued) */
[state="0"], /* Downloading */
[state="4"]) /* Paused */)
.downloadCancel,
/* Blocked (dirty) downloads that have not been confirmed and
- have temporary data. */
+ have temporary data, for the Malware case. */
.download-state:not( [state="8"] /* Blocked (dirty) */)
.downloadConfirmBlock,
.download-state[state="8"]:not(.temporary-block)
.downloadConfirmBlock,
+.download-state[state="8"].temporary-block:not([verdict="Malware"])
+ .downloadConfirmBlock,
+
+/* Blocked (dirty) downloads that have not been confirmed and
+ have temporary data, for cases other than Malware. */
+.download-state:not( [state="8"] /* Blocked (dirty) */)
+ .downloadUnblock,
+.download-state[state="8"]:not(.temporary-block)
+ .downloadUnblock,
+.download-state[state="8"].temporary-block[verdict="Malware"]
+ .downloadUnblock,
.download-state:not(:-moz-any([state="2"], /* Failed */
[state="3"]) /* Canceled */)
.downloadRetry,
.download-state:not( [state="1"] /* Finished */)
.downloadShow
--- a/browser/themes/linux/downloads/downloads.css
+++ b/browser/themes/linux/downloads/downloads.css
@@ -74,16 +74,25 @@
}
@item@:hover .downloadButton.downloadIconCancel:active {
-moz-image-region: rect(0px, 64px, 16px, 48px);
}
.downloadButton.downloadIconShow {
-moz-image-region: rect(16px, 16px, 32px, 0px);
}
+@itemNotFinished@:hover .downloadButton.downloadIconShow {
+ -moz-image-region: rect(16px, 32px, 32px, 16px);
+}
+@itemNotFinished@:hover .downloadButton.downloadIconShow:hover {
+ -moz-image-region: rect(16px, 48px, 32px, 32px);
+}
+@itemNotFinished@:hover .downloadButton.downloadIconShow:active {
+ -moz-image-region: rect(16px, 64px, 32px, 48px);
+}
@notKeyfocus@ @itemFinished@:hover .downloadButton.downloadIconShow {
-moz-image-region: rect(16px, 96px, 32px, 80px);
}
@notKeyfocus@ @itemFinished@:hover .downloadButton.downloadIconShow:hover {
-moz-image-region: rect(16px, 112px, 32px, 96px);
}
@notKeyfocus@ @itemFinished@:hover .downloadButton.downloadIconShow:active {
-moz-image-region: rect(16px, 128px, 32px, 112px);
--- a/browser/themes/osx/downloads/downloads.css
+++ b/browser/themes/osx/downloads/downloads.css
@@ -87,22 +87,25 @@
}
@keyfocus@ @itemFocused@:hover .downloadButton.downloadIconCancel:active {
-moz-image-region: rect(0px, 128px, 16px, 112px);
}
.downloadButton.downloadIconShow {
-moz-image-region: rect(16px, 16px, 32px, 0px);
}
+@notKeyfocus@ @itemNotFinished@:hover .downloadButton.downloadIconShow,
@keyfocus@ @itemFinished@:hover:not([selected]) .downloadButton.downloadIconShow {
-moz-image-region: rect(16px, 32px, 32px, 16px);
}
+@notKeyfocus@ @itemNotFinished@:hover .downloadButton.downloadIconShow:hover,
@keyfocus@ @itemFinished@:hover:not([selected]) .downloadButton.downloadIconShow:hover {
-moz-image-region: rect(16px, 48px, 32px, 32px);
}
+@notKeyfocus@ @itemNotFinished@:hover .downloadButton.downloadIconShow:active,
@keyfocus@ @itemFinished@:hover:not([selected]) .downloadButton.downloadIconShow:active {
-moz-image-region: rect(16px, 64px, 32px, 48px);
}
@keyfocus@ @itemFocused@ .downloadButton.downloadIconShow {
-moz-image-region: rect(16px, 80px, 32px, 64px);
}
@notKeyfocus@ @itemFinished@:hover .downloadButton.downloadIconShow,
@keyfocus@ @itemFocused@:hover .downloadButton.downloadIconShow {
@@ -174,22 +177,25 @@
}
@keyfocus@ @itemFocused@:hover .downloadButton.downloadIconCancel:active {
-moz-image-region: rect(0px, 256px, 32px, 224px);
}
.downloadButton.downloadIconShow {
-moz-image-region: rect(32px, 32px, 64px, 0px);
}
+ @notKeyfocus@ @itemNotFinished@:hover .downloadButton.downloadIconShow,
@keyfocus@ @itemFinished@:hover:not([selected]) .downloadButton.downloadIconShow {
-moz-image-region: rect(32px, 64px, 64px, 32px);
}
+ @notKeyfocus@ @itemNotFinished@:hover .downloadButton.downloadIconShow:hover,
@keyfocus@ @itemFinished@:hover:not([selected]) .downloadButton.downloadIconShow:hover {
-moz-image-region: rect(32px, 96px, 64px, 64px);
}
+ @notKeyfocus@ @itemNotFinished@:hover .downloadButton.downloadIconShow:active,
@keyfocus@ @itemFinished@:hover:not([selected]) .downloadButton.downloadIconShow:active {
-moz-image-region: rect(32px, 128px, 64px, 96px);
}
@keyfocus@ @itemFocused@ .downloadButton.downloadIconShow {
-moz-image-region: rect(32px, 160px, 64px, 128px);
}
@notKeyfocus@ @itemFinished@:hover .downloadButton.downloadIconShow,
@keyfocus@ @itemFocused@:hover .downloadButton.downloadIconShow {
--- a/browser/themes/shared/downloads/downloads.inc.css
+++ b/browser/themes/shared/downloads/downloads.inc.css
@@ -3,16 +3,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%filter substitution
%define keyfocus #downloadsPanel[keyfocus]
%define notKeyfocus #downloadsPanel:not([keyfocus])
%define item richlistitem[type="download"]
%define itemFinished @item@[state="1"]
+%define itemNotFinished @item@:not([state="1"])
%define itemFocused #downloadsListBox:focus > @item@[selected]
/*** Panel and outer controls ***/
#downloadsPanel > .panel-arrowcontainer > .panel-arrowcontent {
padding: 0;
}