Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6369)

Unified Diff: chrome/browser/resources/md_downloads/item.js

Issue 1268023002: MD downloads: implement real warning icon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dl-search-x
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_downloads/item.js
diff --git a/chrome/browser/resources/md_downloads/item.js b/chrome/browser/resources/md_downloads/item.js
index bb6389fed7ada837f846f4fc8c22146c712fd050..672153eb1868e93bf98f55342160d35cc7536d8f 100644
--- a/chrome/browser/resources/md_downloads/item.js
+++ b/chrome/browser/resources/md_downloads/item.js
@@ -85,22 +85,12 @@ cr.define('downloads', function() {
this.$.progress.value = data.percent;
}
- var iconUrl = 'chrome://';
-
if (this.isDangerous_) {
- var dangerType = data.danger_type;
-
this.isMalware_ =
- dangerType == downloads.DangerType.DANGEROUS_CONTENT ||
- dangerType == downloads.DangerType.DANGEROUS_HOST ||
- dangerType == downloads.DangerType.DANGEROUS_URL ||
- dangerType == downloads.DangerType.POTENTIALLY_UNWANTED;
-
- // TODO(dbeam): this icon sucks: it's a PNG we have to scale and looks
- // nothing like the mocks. Find a prettier, more vectorized version.
- var dangerousFile = dangerType == downloads.DangerType.DANGEROUS_FILE;
groby-ooo-7-16 2015/08/04 00:56:06 I'm slightly confused. Who's setting up the URL fo
Dan Beam 2015/08/04 01:11:20 the new UI shows the same warning icon regardless
- var idr = dangerousFile ? 'IDR_WARNING' : 'IDR_SAFEBROWSING_WARNING';
- iconUrl += 'theme/' + idr;
+ data.danger_type == downloads.DangerType.DANGEROUS_CONTENT ||
+ data.danger_type == downloads.DangerType.DANGEROUS_HOST ||
+ data.danger_type == downloads.DangerType.DANGEROUS_URL ||
+ data.danger_type == downloads.DangerType.POTENTIALLY_UNWANTED;
} else {
/** @const */ var completelyOnDisk =
data.state == downloads.States.COMPLETE &&
@@ -138,10 +128,9 @@ cr.define('downloads', function() {
link.textContent = data.by_ext_name;
}
- iconUrl += 'fileicon/' + encodeURIComponent(data.file_path);
+ var icon = 'chrome://fileicon/' + encodeURIComponent(data.file_path);
+ this.iconLoader_.loadScaledIcon(this.$.icon, icon);
}
-
- this.iconLoader_.loadScaledIcon(this.$.icon, iconUrl);
},
/**

Powered by Google App Engine
This is Rietveld 408576698