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
--- 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>