Bug 1350063 - urlbarBindings.xml should use AppConstants from the global scope; r=dao
authorFederico Padua <federico_padua@yahoo.it>
Sat, 25 Mar 2017 18:50:03 +0100
changeset 349625 31235aad2d6a264f845c168412809840cfbdc58d
parent 349624 3b66896de51f9bef615f5519e73630964fd86e1e
child 349626 e6405802bfc0881d8cf36e250eaca1732b25ece2
push id39530
push userdgottwald@mozilla.com
push dateSat, 25 Mar 2017 17:55:49 +0000
treeherderautoland@31235aad2d6a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1350063
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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>