Bug 916726 - r=gavin a=lsblakk
authorFelipe Gomes <felipc@gmail.com>
Wed, 04 Dec 2013 23:18:42 -0200
changeset 167691 d70f382c7a59de9465d2832daf7e2c3a78875ccf
parent 167690 68b9b190c22b08b0115e046ca2ec395b4f2fec8c
child 167692 28c5128b89258dde6446b61ccb313d7f0987a8bf
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin, lsblakk
bugs916726
milestone27.0
Bug 916726 - r=gavin a=lsblakk
modules/libpref/src/init/all.js
toolkit/mozapps/downloads/nsHelperAppDlg.js
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -1600,17 +1600,17 @@ pref("font.blacklist.underline_offset", 
 
 pref("images.dither", "auto");
 pref("security.directory",              "");
 
 pref("signed.applets.codebase_principal_support", false);
 pref("security.checkloaduri", true);
 pref("security.xpconnect.plugin.unrestricted", true);
 // security-sensitive dialogs should delay button enabling. In milliseconds.
-pref("security.dialog_enable_delay", 2000);
+pref("security.dialog_enable_delay", 1000);
 pref("security.notification_enable_delay", 500);
 
 pref("security.csp.enable", true);
 pref("security.csp.debug", false);
 
 // Mixed content blocking
 pref("security.mixed_content.block_active_content", false);
 pref("security.mixed_content.block_display_content", false);
--- a/toolkit/mozapps/downloads/nsHelperAppDlg.js
+++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js
@@ -1,16 +1,18 @@
 /* -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /*
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
 
+Components.utils.import("resource://gre/modules/Services.jsm");
+
 ///////////////////////////////////////////////////////////////////////////////
 //// Helper Functions
 
 /**
  * Determines if a given directory is able to be used to download to.
  *
  * @param aDirectory
  *        The directory to check.
@@ -475,20 +477,21 @@ nsUnknownContentTypeDialog.prototype = {
       var openHandler = this.dialogElement("openHandler");
       openHandler.parentNode.removeChild(openHandler);
       var openHandlerBox = this.dialogElement("openHandlerBox");
       openHandlerBox.appendChild(openHandler);
     }
 
     this.mDialog.setTimeout("dialog.postShowCallback()", 0);
 
+    let acceptDelay = Services.prefs.getIntPref("security.dialog_enable_delay");
     this.mDialog.document.documentElement.getButton("accept").disabled = true;
     this._showTimer = Components.classes["@mozilla.org/timer;1"]
                                 .createInstance(nsITimer);
-    this._showTimer.initWithCallback(this, 250, nsITimer.TYPE_ONE_SHOT);
+    this._showTimer.initWithCallback(this, acceptDelay, nsITimer.TYPE_ONE_SHOT);
   },
 
   notify: function (aTimer) {
     if (aTimer == this._showTimer) {
       if (!this.mDialog) {
         this.reallyShow();
       } else {
         // The user may have already canceled the dialog.