summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources
diff options
context:
space:
mode:
authorlzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-01 00:20:40 +0000
committerlzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-01 00:20:40 +0000
commitc0f8a593bbc5a967c4c0037a724c021da62079de (patch)
tree4c8336a6dfdc896e2d5c92ab57b2c77990423c72 /chrome/browser/resources
parentfbd31eb81436cf7f6d4f9ea3683c100f112361e6 (diff)
downloadchromium_src-c0f8a593bbc5a967c4c0037a724c021da62079de.zip
chromium_src-c0f8a593bbc5a967c4c0037a724c021da62079de.tar.gz
chromium_src-c0f8a593bbc5a967c4c0037a724c021da62079de.tar.bz2
Show the right info for dangerous download in history.
TEST=none BUG=none Review URL: http://codereview.chromium.org/6581013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76321 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r--chrome/browser/resources/downloads.html22
1 files changed, 19 insertions, 3 deletions
diff --git a/chrome/browser/resources/downloads.html b/chrome/browser/resources/downloads.html
index 013da50..d26e031 100644
--- a/chrome/browser/resources/downloads.html
+++ b/chrome/browser/resources/downloads.html
@@ -468,6 +468,15 @@ Download.States = {
}
/**
+ * Explains why a download is in DANGEROUS state.
+ */
+Download.DangerType = {
+ NOT_DANGEROUS: "NOT_DANGEROUS",
+ DANGEROUS_FILE: "DANGEROUS_FILE",
+ DANGEROUS_URL: "DANGEROUS_URL",
+}
+
+/**
* Constants for the progress meter.
*/
Download.Progress = {
@@ -490,6 +499,7 @@ Download.prototype.update = function(download) {
this.fileName_ = download.file_name;
this.url_ = download.url;
this.state_ = download.state;
+ this.dangerType_ = download.danger_type;
this.since_ = download.since_string;
this.date_ = download.date_string;
@@ -500,8 +510,12 @@ Download.prototype.update = function(download) {
this.received_ = download.received;
if (this.state_ == Download.States.DANGEROUS) {
- this.dangerDesc_.innerHTML = localStrings.getStringF('danger_desc',
- this.fileName_);
+ if (this.dangerType_ == Download.DangerType.DANGEROUS_FILE) {
+ this.dangerDesc_.innerHTML = localStrings.getStringF('danger_file_desc',
+ this.fileName_);
+ } else {
+ this.dangerDesc_.innerHTML = localStrings.getString('danger_url_desc');
+ }
this.danger_.style.display = 'block';
this.safe_.style.display = 'none';
} else {
@@ -605,7 +619,9 @@ Download.prototype.getStatusText_ = function() {
case Download.States.PAUSED:
return localStrings.getString('status_paused');
case Download.States.DANGEROUS:
- return localStrings.getString('danger_desc');
+ var desc = this.dangerType_ == Download.DangerType.DANGEROUS_FILE ?
+ 'danger_file_desc' : 'danger_url_desc';
+ return localStrings.getString(desc);
case Download.States.COMPLETE:
return '';
}