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

Side by Side Diff: chrome/browser/resources/downloads.js

Issue 9621007: Add new danger type for uncommon or unknown downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased only Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Helper functions 6 // Helper functions
7 function $(o) {return document.getElementById(o);} 7 function $(o) {return document.getElementById(o);}
8 8
9 /** 9 /**
10 * Sets the display style of a node. 10 * Sets the display style of a node.
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 INTERRUPTED : "INTERRUPTED", 335 INTERRUPTED : "INTERRUPTED",
336 } 336 }
337 337
338 /** 338 /**
339 * Explains why a download is in DANGEROUS state. 339 * Explains why a download is in DANGEROUS state.
340 */ 340 */
341 Download.DangerType = { 341 Download.DangerType = {
342 NOT_DANGEROUS: "NOT_DANGEROUS", 342 NOT_DANGEROUS: "NOT_DANGEROUS",
343 DANGEROUS_FILE: "DANGEROUS_FILE", 343 DANGEROUS_FILE: "DANGEROUS_FILE",
344 DANGEROUS_URL: "DANGEROUS_URL", 344 DANGEROUS_URL: "DANGEROUS_URL",
345 DANGEROUS_CONTENT: "DANGEROUS_CONTENT" 345 DANGEROUS_CONTENT: "DANGEROUS_CONTENT",
346 UNCOMMON_CONTENT: "UNCOMMON_CONTENT"
346 } 347 }
347 348
348 /** 349 /**
349 * Constants for the progress meter. 350 * Constants for the progress meter.
350 */ 351 */
351 Download.Progress = { 352 Download.Progress = {
352 width : 48, 353 width : 48,
353 height : 48, 354 height : 48,
354 radius : 24, 355 radius : 24,
355 centerX : 24, 356 centerX : 24,
(...skipping 26 matching lines...) Expand all
382 383
383 if (this.state_ == Download.States.DANGEROUS) { 384 if (this.state_ == Download.States.DANGEROUS) {
384 if (this.dangerType_ == Download.DangerType.DANGEROUS_FILE) { 385 if (this.dangerType_ == Download.DangerType.DANGEROUS_FILE) {
385 this.dangerDesc_.textContent = localStrings.getStringF('danger_file_desc', 386 this.dangerDesc_.textContent = localStrings.getStringF('danger_file_desc',
386 this.fileName_); 387 this.fileName_);
387 } else if (this.dangerType_ == Download.DangerType.DANGEROUS_URL) { 388 } else if (this.dangerType_ == Download.DangerType.DANGEROUS_URL) {
388 this.dangerDesc_.textContent = localStrings.getString('danger_url_desc'); 389 this.dangerDesc_.textContent = localStrings.getString('danger_url_desc');
389 } else if (this.dangerType_ == Download.DangerType.DANGEROUS_CONTENT) { 390 } else if (this.dangerType_ == Download.DangerType.DANGEROUS_CONTENT) {
390 this.dangerDesc_.textContent = localStrings.getStringF( 391 this.dangerDesc_.textContent = localStrings.getStringF(
391 'danger_content_desc', this.fileName_); 392 'danger_content_desc', this.fileName_);
393 } else if (this.dangerType_ == Download.DangerType.UNCOMMON_CONTENT) {
394 this.dangerDesc_.textContent = localStrings.getStringF(
395 'danger_uncommon_desc', this.fileName_);
392 } 396 }
393 this.danger_.style.display = 'block'; 397 this.danger_.style.display = 'block';
394 this.safe_.style.display = 'none'; 398 this.safe_.style.display = 'none';
395 } else { 399 } else {
396 downloads.scheduleIconLoad(this.nodeImg_, 400 downloads.scheduleIconLoad(this.nodeImg_,
397 'chrome://fileicon/' + 401 'chrome://fileicon/' +
398 encodeURIComponent(this.filePath_)); 402 encodeURIComponent(this.filePath_));
399 403
400 if (this.state_ == Download.States.COMPLETE && 404 if (this.state_ == Download.States.COMPLETE &&
401 !this.fileExternallyRemoved_) { 405 !this.fileExternallyRemoved_) {
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 openDownloadsFolderLink.oncontextmenu = function() { return false; }; 690 openDownloadsFolderLink.oncontextmenu = function() { return false; };
687 691
688 $('search-link').onclick = function () { 692 $('search-link').onclick = function () {
689 setSearch(''); 693 setSearch('');
690 return false; 694 return false;
691 }; 695 };
692 $('search-form').onsubmit = function () { 696 $('search-form').onsubmit = function () {
693 setSearch(this.term.value); 697 setSearch(this.term.value);
694 return false; 698 return false;
695 }; 699 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698