Bug 1471811 - "ReferenceError: Services is not defined" in autocomplete.xml. r=Gijs,jorgk

Differential Revision: https://phabricator.services.mozilla.com/D12889

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Marco Bonardo 2018-11-26 12:14:14 +00:00
Родитель 66d5164c37
Коммит 5c77a41d60
1 изменённых файлов: 23 добавлений и 5 удалений

Просмотреть файл

@ -1226,7 +1226,7 @@
<handlers> <handlers>
<handler event="click" button="0"><![CDATA[ <handler event="click" button="0"><![CDATA[
let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL"); let baseURL = this.Services.urlFormatter.formatURLPref("app.support.baseURL");
window.openTrustedLinkIn(baseURL + "insecure-password", "tab", { window.openTrustedLinkIn(baseURL + "insecure-password", "tab", {
relatedToCurrent: true, relatedToCurrent: true,
}); });
@ -1245,7 +1245,7 @@
<getter><![CDATA[ <getter><![CDATA[
if (!this.__learnMoreString) { if (!this.__learnMoreString) {
this.__learnMoreString = this.__learnMoreString =
Services.strings.createBundle("chrome://passwordmgr/locale/passwordmgr.properties"). this.Services.strings.createBundle("chrome://passwordmgr/locale/passwordmgr.properties").
GetStringFromName("insecureFieldWarningLearnMore"); GetStringFromName("insecureFieldWarningLearnMore");
} }
return this.__learnMoreString; return this.__learnMoreString;
@ -1352,6 +1352,24 @@
]]> ]]>
</constructor> </constructor>
<property name="Services" readonly="true">
<getter><![CDATA[
let module = {};
if (window.Services) {
module.Services = window.Services;
} else {
ChromeUtils.import("resource://gre/modules/Services.jsm", module);
}
Object.defineProperty(this, "Services", {
configurable: true,
enumerable: true,
writable: true,
value: module.Services,
});
return module.Services;
]]></getter>
</property>
<method name="_cleanup"> <method name="_cleanup">
<body> <body>
<![CDATA[ <![CDATA[
@ -1391,7 +1409,7 @@
<property name="_stringBundle"> <property name="_stringBundle">
<getter><![CDATA[ <getter><![CDATA[
if (!this.__stringBundle) { if (!this.__stringBundle) {
this.__stringBundle = Services.strings.createBundle("chrome://global/locale/autocomplete.properties"); this.__stringBundle = this.Services.strings.createBundle("chrome://global/locale/autocomplete.properties");
} }
return this.__stringBundle; return this.__stringBundle;
]]></getter> ]]></getter>
@ -1739,7 +1757,7 @@
<parameter name="url"/> <parameter name="url"/>
<body> <body>
<![CDATA[ <![CDATA[
return Services.textToSubURI.unEscapeURIForUI("UTF-8", url); return this.Services.textToSubURI.unEscapeURIForUI("UTF-8", url);
]]> ]]>
</body> </body>
</method> </method>
@ -1961,7 +1979,7 @@
if (!title) { if (!title) {
titleLooksLikeUrl = true; titleLooksLikeUrl = true;
try { try {
let uri = Services.io.newURI(originalUrl); let uri = this.Services.io.newURI(originalUrl);
// Not all valid URLs have a domain. // Not all valid URLs have a domain.
if (uri.host) if (uri.host)
title = uri.host; title = uri.host;