Bug 1350063 - urlbarBindings.xml should use AppConstants from the global scope; r?dao draft
authorFederico Padua <federico_padua@yahoo.it>
Sat, 25 Mar 2017 18:50:03 +0100
changeset 551326 13e923828f0b040d7592a57deb59e2d4b5f11072
parent 551223 65b0ac174753b22c01156d72fb42d2abd3176dd1
child 621519 07d05528ec200335e6b6851b4d73fe4d0813e0c6
push id51025
push userbmo:federico_padua@yahoo.it
push dateSat, 25 Mar 2017 17:50:39 +0000
reviewersdao
bugs1350063
milestone55.0a1
Bug 1350063 - urlbarBindings.xml should use AppConstants from the global scope; r?dao This patch makes urlbarBindings.xml use AppConstants from the global scope and removes the related field. MozReview-Commit-ID: E2KvOsZVX7q
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -48,20 +48,16 @@ file, You can obtain one at http://mozil
         <children includes="hbox"/>
       </xul:hbox>
       <xul:popupset anonid="popupset"
                     class="autocomplete-result-popupset"/>
       <children includes="toolbarbutton"/>
     </content>
 
     <implementation implements="nsIObserver, nsIDOMEventListener">
-      <field name="AppConstants" readonly="true">
-        (Components.utils.import("resource://gre/modules/AppConstants.jsm", {})).AppConstants;
-      </field>
-
       <field name="ExtensionSearchHandler" readonly="true">
         (Components.utils.import("resource://gre/modules/ExtensionSearchHandler.jsm", {})).ExtensionSearchHandler;
       </field>
 
       <constructor><![CDATA[
         this._prefs = Components.classes["@mozilla.org/preferences-service;1"]
                                 .getService(Components.interfaces.nsIPrefService)
                                 .getBranch("browser.urlbar.");
@@ -636,17 +632,17 @@ file, You can obtain one at http://mozil
           // Only add the suffix when the URL bar value isn't already "URL-like",
           // and only if we get a keyboard event, to match user expectations.
           if (!/^\s*[^.:\/\s]+(?:\/.*|\s*)$/i.test(aUrl) ||
               !(aTriggeringEvent instanceof KeyEvent)) {
             return;
           }
 
           let url = aUrl;
-          let accel = this.AppConstants.platform == "macosx" ?
+          let accel = AppConstants.platform == "macosx" ?
                       aTriggeringEvent.metaKey :
                       aTriggeringEvent.ctrlKey;
           let shift = aTriggeringEvent.shiftKey;
           let suffix = "";
 
           switch (true) {
             case (accel && shift):
               suffix = ".org/";
@@ -1075,17 +1071,17 @@ file, You can obtain one at http://mozil
 
       <property name="_noActionKeys" readonly="true">
         <getter><![CDATA[
           if (!this.__noActionKeys) {
             this.__noActionKeys = new Set([
               KeyEvent.DOM_VK_ALT,
               KeyEvent.DOM_VK_SHIFT,
             ]);
-            let modifier = this.AppConstants.platform == "macosx" ?
+            let modifier = AppConstants.platform == "macosx" ?
                            KeyEvent.DOM_VK_META :
                            KeyEvent.DOM_VK_CONTROL;
             this.__noActionKeys.add(modifier);
           }
           return this.__noActionKeys;
         ]]></getter>
       </property>