OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Wrapper for chrome.send. | 6 * Wrapper for chrome.send. |
7 */ | 7 */ |
8 function chromeSend(func, arg) { | 8 function chromeSend(func, arg) { |
9 if (arg == undefined) | 9 if (arg == undefined) |
10 arg = ''; | 10 arg = ''; |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 | 375 |
376 DANGEROUS_HEIGHT: 60, | 376 DANGEROUS_HEIGHT: 60, |
377 createDangerousPrompt_: function(dangerType) { | 377 createDangerousPrompt_: function(dangerType) { |
378 if (this.dangerous) | 378 if (this.dangerous) |
379 return; | 379 return; |
380 | 380 |
381 this.dangerous = createChild('div', 'dangerousprompt', this.rowbutton); | 381 this.dangerous = createChild('div', 'dangerousprompt', this.rowbutton); |
382 | 382 |
383 // Handle dangerous files, extensions and dangerous urls. | 383 // Handle dangerous files, extensions and dangerous urls. |
384 var dangerText; | 384 var dangerText; |
385 if (dangerType == 'DANGEROUS_URL' || dangerType == 'DANGEROUS_CONTENT') { | 385 if (dangerType == 'DANGEROUS_URL') { |
386 dangerText = localStrings.getString('dangerousurl'); | 386 dangerText = localStrings.getString('dangerousurl'); |
| 387 } else if (dangerType == 'DANGEROUS_CONTENT') { |
| 388 dangerText = localStrings.getStringF('dangerouscontent', this.name); |
387 } else if (dangerType == 'DANGEROUS_FILE' && this.path.match(/\.crx$/)) { | 389 } else if (dangerType == 'DANGEROUS_FILE' && this.path.match(/\.crx$/)) { |
388 dangerText = localStrings.getString('dangerousextension'); | 390 dangerText = localStrings.getString('dangerousextension'); |
389 } else { | 391 } else { |
390 dangerText = localStrings.getStringF('dangerousfile', this.name); | 392 dangerText = localStrings.getStringF('dangerousfile', this.name); |
391 } | 393 } |
392 createChild('span', 'dangerousprompttext', this.dangerous, dangerText); | 394 createChild('span', 'dangerousprompttext', this.dangerous, dangerText); |
393 | 395 |
394 var self = this; | 396 var self = this; |
395 createChild('span', 'confirm', this.dangerous, | 397 createChild('span', 'confirm', this.dangerous, |
396 localStrings.getString('discard'), | 398 localStrings.getString('discard'), |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 update: function(result) { | 671 update: function(result) { |
670 var row = this.getRow(result.file_path); | 672 var row = this.getRow(result.file_path); |
671 if (!row && !DiscardResult(result)) | 673 if (!row && !DiscardResult(result)) |
672 row = new DownloadRow(this, result); | 674 row = new DownloadRow(this, result); |
673 | 675 |
674 row && row.update(result); | 676 row && row.update(result); |
675 }, | 677 }, |
676 }; | 678 }; |
677 | 679 |
678 document.addEventListener('DOMContentLoaded', init); | 680 document.addEventListener('DOMContentLoaded', init); |
OLD | NEW |