From 139f20eff959435c0ddb7a147f95b2d2c1b7a4fc Mon Sep 17 00:00:00 2001 From: Paolo Amadini Date: Fri, 15 Apr 2016 15:44:33 +0100 Subject: [PATCH] Bug 1198181 - Part 3 - Showing the unblock dialog should be the visible action for verdicts other than malware. r=past MozReview-Commit-ID: GJNojR8L3Mx --HG-- extra : rebase_source : 2626cf280548ff60b4c5cf316513757082617e28 --- browser/components/downloads/DownloadsViewUI.jsm | 8 ++++++++ browser/components/downloads/content/download.xml | 3 +++ browser/components/downloads/content/downloads.css | 13 ++++++++++++- browser/themes/linux/downloads/downloads.css | 9 +++++++++ browser/themes/osx/downloads/downloads.css | 6 ++++++ browser/themes/shared/downloads/downloads.inc.css | 1 + 6 files changed, 39 insertions(+), 1 deletion(-) diff --git a/browser/components/downloads/DownloadsViewUI.jsm b/browser/components/downloads/DownloadsViewUI.jsm index d26add83a29d..a5c4995e4048 100644 --- a/browser/components/downloads/DownloadsViewUI.jsm +++ b/browser/components/downloads/DownloadsViewUI.jsm @@ -112,6 +112,14 @@ this.DownloadsViewUI.DownloadElementShell.prototype = { 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; diff --git a/browser/components/downloads/content/download.xml b/browser/components/downloads/content/download.xml index e31e4dd7b62b..245b142c0745 100644 --- a/browser/components/downloads/content/download.xml +++ b/browser/components/downloads/content/download.xml @@ -63,6 +63,9 @@ + diff --git a/browser/components/downloads/content/downloads.css b/browser/components/downloads/content/downloads.css index 3eb49a4603a7..b60345dd68e2 100644 --- a/browser/components/downloads/content/downloads.css +++ b/browser/components/downloads/content/downloads.css @@ -118,11 +118,22 @@ richlistitem.download button { .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 */) diff --git a/browser/themes/linux/downloads/downloads.css b/browser/themes/linux/downloads/downloads.css index 6965140bed92..a607ec0d0b3c 100644 --- a/browser/themes/linux/downloads/downloads.css +++ b/browser/themes/linux/downloads/downloads.css @@ -79,6 +79,15 @@ .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); } diff --git a/browser/themes/osx/downloads/downloads.css b/browser/themes/osx/downloads/downloads.css index dca0b778b554..ef182e55c97a 100644 --- a/browser/themes/osx/downloads/downloads.css +++ b/browser/themes/osx/downloads/downloads.css @@ -92,12 +92,15 @@ .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); } @@ -179,12 +182,15 @@ .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); } diff --git a/browser/themes/shared/downloads/downloads.inc.css b/browser/themes/shared/downloads/downloads.inc.css index ab9c5c42a1ef..eda6a4a331e8 100644 --- a/browser/themes/shared/downloads/downloads.inc.css +++ b/browser/themes/shared/downloads/downloads.inc.css @@ -8,6 +8,7 @@ %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 ***/