Bug 1371554 - Use Components.aliases where not used. r=mattn.
MozReview-Commit-ID: 8uElbXeSN3J
--- a/toolkit/components/satchel/FormHistoryStartup.js
+++ b/toolkit/components/satchel/FormHistoryStartup.js
@@ -1,16 +1,16 @@
/* 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/. */
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+Cu.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "FormHistory",
"resource://gre/modules/FormHistory.jsm");
function FormHistoryStartup() {
this.wrappedJSObject = this;
}
--- a/toolkit/components/satchel/formSubmitListener.js
+++ b/toolkit/components/satchel/formSubmitListener.js
@@ -3,19 +3,19 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env mozilla/frame-script */
(function() {
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+Cu.import("resource://gre/modules/Services.jsm");
+Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
var satchelFormListener = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFormSubmitObserver,
Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
debug: true,
enabled: true,
--- a/toolkit/components/satchel/nsFormAutoCompleteResult.jsm
+++ b/toolkit/components/satchel/nsFormAutoCompleteResult.jsm
@@ -1,17 +1,17 @@
/* 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/. */
this.EXPORTED_SYMBOLS = [ "FormAutoCompleteResult" ];
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
this.FormAutoCompleteResult =
function FormAutoCompleteResult(searchString,
searchResult,
defaultIndex,
errorDescription,
values,
labels,
--- a/toolkit/components/satchel/nsInputListAutoComplete.js
+++ b/toolkit/components/satchel/nsInputListAutoComplete.js
@@ -1,17 +1,17 @@
/* 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/. */
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/nsFormAutoCompleteResult.jsm");
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+Cu.import("resource://gre/modules/Services.jsm");
+Cu.import("resource://gre/modules/nsFormAutoCompleteResult.jsm");
function InputListAutoComplete() {}
InputListAutoComplete.prototype = {
classID: Components.ID("{bf1e01d0-953e-11df-981c-0800200c9a66}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIInputListAutoComplete]),
autoCompleteSearch(aUntrimmedSearchString, aField) {
--- a/toolkit/components/satchel/test/unit/head_satchel.js
+++ b/toolkit/components/satchel/test/unit/head_satchel.js
@@ -1,22 +1,22 @@
/* 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/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/FormHistory.jsm");
-
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
const CURRENT_SCHEMA = 4;
const PR_HOURS = 60 * 60 * 1000000;
let RUN_AUTOFILL_TEST = true;
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+Cu.import("resource://gre/modules/Services.jsm");
+Cu.import("resource://gre/modules/FormHistory.jsm");
+
do_get_profile();
// Load our bootstrap extension manifest so we can access our chrome/resource URIs.
const EXTENSION_ID = "formautofill@mozilla.org";
let extensionDir = Services.dirsvc.get("GreD", Ci.nsIFile);
extensionDir.append("browser");
extensionDir.append("features");
--- a/toolkit/components/satchel/test/unit/test_previous_result.js
+++ b/toolkit/components/satchel/test/unit/test_previous_result.js
@@ -14,11 +14,11 @@ var aaListener = {
do_check_eq(result.searchString, "aa");
search.startSearch("aaa", "", result, aaaListener);
}
};
function run_test() {
do_test_pending();
let search = Cc["@mozilla.org/autocomplete/search;1?name=form-history"].
- getService(Components.interfaces.nsIAutoCompleteSearch);
+ getService(Ci.nsIAutoCompleteSearch);
search.startSearch("aa", "", null, aaListener);
}