Commit 918ed6c4 authored by Kris Maglione's avatar Kris Maglione
Browse files

Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian

This was done using the following script:
https://bitbucket.org/kmaglione/m-c-rewrites/src/37e3803c7a23385bab5ea077ba8692bcfe1608fc/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
parent 6425ff4f
......@@ -10,11 +10,11 @@ const {utils: Cu, interfaces: Ci} = Components;
this.EXPORTED_SYMBOLS = ["AccessFu"]; // jshint ignore:line
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/accessibility/Utils.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/accessibility/Utils.jsm");
if (Utils.MozBuildApp === "mobile/android") {
Cu.import("resource://gre/modules/Messaging.jsm");
ChromeUtils.import("resource://gre/modules/Messaging.jsm");
}
const ACCESSFU_DISABLE = 0; // jshint ignore:line
......@@ -79,9 +79,9 @@ this.AccessFu = { // jshint ignore:line
}
this._enabled = true;
Cu.import("resource://gre/modules/accessibility/Utils.jsm");
Cu.import("resource://gre/modules/accessibility/PointerAdapter.jsm");
Cu.import("resource://gre/modules/accessibility/Presentation.jsm");
ChromeUtils.import("resource://gre/modules/accessibility/Utils.jsm");
ChromeUtils.import("resource://gre/modules/accessibility/PointerAdapter.jsm");
ChromeUtils.import("resource://gre/modules/accessibility/Presentation.jsm");
for (let mm of Utils.AllMessageManagers) {
this._addMessageListeners(mm);
......@@ -519,7 +519,7 @@ var Output = {
},
start: function start() {
Cu.import("resource://gre/modules/Geometry.jsm");
ChromeUtils.import("resource://gre/modules/Geometry.jsm");
},
stop: function stop() {
......
const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
this.EXPORTED_SYMBOLS = ["Roles", "Events", "Relations",
"Filters", "States", "Prefilters"];
......
......@@ -5,20 +5,20 @@
var Ci = Components.interfaces;
var Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Services",
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.defineModuleGetter(this, "Services",
"resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Utils",
ChromeUtils.defineModuleGetter(this, "Utils",
"resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Logger",
ChromeUtils.defineModuleGetter(this, "Logger",
"resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Roles",
ChromeUtils.defineModuleGetter(this, "Roles",
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TraversalRules",
ChromeUtils.defineModuleGetter(this, "TraversalRules",
"resource://gre/modules/accessibility/Traversal.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TraversalHelper",
ChromeUtils.defineModuleGetter(this, "TraversalHelper",
"resource://gre/modules/accessibility/Traversal.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Presentation",
ChromeUtils.defineModuleGetter(this, "Presentation",
"resource://gre/modules/accessibility/Presentation.jsm");
this.EXPORTED_SYMBOLS = ["ContentControl"];
......
......@@ -9,20 +9,20 @@ const Cu = Components.utils;
const TEXT_NODE = 3;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Services",
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.defineModuleGetter(this, "Services",
"resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Utils",
ChromeUtils.defineModuleGetter(this, "Utils",
"resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Logger",
ChromeUtils.defineModuleGetter(this, "Logger",
"resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Presentation",
ChromeUtils.defineModuleGetter(this, "Presentation",
"resource://gre/modules/accessibility/Presentation.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Roles",
ChromeUtils.defineModuleGetter(this, "Roles",
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Events",
ChromeUtils.defineModuleGetter(this, "Events",
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "States",
ChromeUtils.defineModuleGetter(this, "States",
"resource://gre/modules/accessibility/Constants.jsm");
this.EXPORTED_SYMBOLS = ["EventManager"];
......
......@@ -40,17 +40,17 @@ const Cu = Components.utils;
this.EXPORTED_SYMBOLS = ["GestureSettings", "GestureTracker"]; // jshint ignore:line
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Utils", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "Utils", // jshint ignore:line
"resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Logger", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "Logger", // jshint ignore:line
"resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "setTimeout", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "setTimeout", // jshint ignore:line
"resource://gre/modules/Timer.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "clearTimeout", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "clearTimeout", // jshint ignore:line
"resource://gre/modules/Timer.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "PromiseUtils", // jshint ignore:line
"resource://gre/modules/PromiseUtils.jsm");
// Default maximum duration of swipe
......
......@@ -17,16 +17,16 @@ const IGNORE_EXPLICIT_NAME = 0x20;
const OUTPUT_DESC_FIRST = 0;
const OUTPUT_DESC_LAST = 1;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Utils", // jshint ignore:line
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.defineModuleGetter(this, "Utils", // jshint ignore:line
"resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrefCache", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "PrefCache", // jshint ignore:line
"resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Logger", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "Logger", // jshint ignore:line
"resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Roles", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "Roles", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "States", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "States", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
this.EXPORTED_SYMBOLS = ["UtteranceGenerator", "BrailleGenerator"]; // jshint ignore:line
......
......@@ -11,15 +11,15 @@ const Cu = Components.utils;
this.EXPORTED_SYMBOLS = ["PointerRelay", "PointerAdapter"]; // jshint ignore:line
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Utils", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "Utils", // jshint ignore:line
"resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Logger", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "Logger", // jshint ignore:line
"resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "GestureSettings", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "GestureSettings", // jshint ignore:line
"resource://gre/modules/accessibility/Gestures.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "GestureTracker", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "GestureTracker", // jshint ignore:line
"resource://gre/modules/accessibility/Gestures.jsm");
// The virtual touch ID generated by a mouse event.
......
......@@ -8,19 +8,19 @@
const {utils: Cu, interfaces: Ci} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Logger", // jshint ignore:line
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/accessibility/Utils.jsm");
ChromeUtils.defineModuleGetter(this, "Logger", // jshint ignore:line
"resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PivotContext", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "PivotContext", // jshint ignore:line
"resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "UtteranceGenerator", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "UtteranceGenerator", // jshint ignore:line
"resource://gre/modules/accessibility/OutputGenerator.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "BrailleGenerator", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "BrailleGenerator", // jshint ignore:line
"resource://gre/modules/accessibility/OutputGenerator.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Roles", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "Roles", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "States", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "States", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
this.EXPORTED_SYMBOLS = ["Presentation"]; // jshint ignore:line
......
......@@ -11,15 +11,15 @@ const Cu = Components.utils;
this.EXPORTED_SYMBOLS = ["TraversalRules", "TraversalHelper"]; // jshint ignore:line
Cu.import("resource://gre/modules/accessibility/Utils.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Roles", // jshint ignore:line
ChromeUtils.import("resource://gre/modules/accessibility/Utils.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.defineModuleGetter(this, "Roles", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Filters", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "Filters", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "States", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "States", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Prefilters", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "Prefilters", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
var gSkipEmptyImages = new PrefCache("accessibility.accessfu.skip_empty_images");
......
......@@ -8,20 +8,20 @@
const {classes: Cc, utils: Cu, interfaces: Ci} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Services", // jshint ignore:line
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.defineModuleGetter(this, "Services", // jshint ignore:line
"resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Rect", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "Rect", // jshint ignore:line
"resource://gre/modules/Geometry.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Roles", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "Roles", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Events", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "Events", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Relations", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "Relations", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "States", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "States", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm", // jshint ignore:line
ChromeUtils.defineModuleGetter(this, "PluralForm", // jshint ignore:line
"resource://gre/modules/PluralForm.jsm");
this.EXPORTED_SYMBOLS = ["Utils", "Logger", "PivotContext", "PrefCache"]; // jshint ignore:line
......
......@@ -7,20 +7,20 @@
var Ci = Components.interfaces;
var Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Logger",
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.defineModuleGetter(this, "Logger",
"resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Presentation",
ChromeUtils.defineModuleGetter(this, "Presentation",
"resource://gre/modules/accessibility/Presentation.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Utils",
ChromeUtils.defineModuleGetter(this, "Utils",
"resource://gre/modules/accessibility/Utils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "EventManager",
ChromeUtils.defineModuleGetter(this, "EventManager",
"resource://gre/modules/accessibility/EventManager.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ContentControl",
ChromeUtils.defineModuleGetter(this, "ContentControl",
"resource://gre/modules/accessibility/ContentControl.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Roles",
ChromeUtils.defineModuleGetter(this, "Roles",
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "States",
ChromeUtils.defineModuleGetter(this, "States",
"resource://gre/modules/accessibility/Constants.jsm");
Logger.info("content-script.js", content.document.location);
......
......@@ -89,7 +89,7 @@ function reloadButton() {
// //////////////////////////////////////////////////////////////////////////////
// private section
Components.utils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
var gBrowserContext =
{
......
......@@ -89,7 +89,7 @@ const MAX_TRIM_LENGTH = 100;
/**
* Services to determine if e10s is enabled.
*/
Components.utils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
/**
* nsIAccessibilityService service.
......
......@@ -40,7 +40,7 @@ const kFromUserInput = 1;
// //////////////////////////////////////////////////////////////////////////////
// General
Components.utils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
/**
* Set up this variable to dump events into DOM.
......
......@@ -17,7 +17,7 @@
<script type="application/javascript">
// Front end stuff sometimes likes to stuff things in the hidden window(s)
// in which case there's accessibles for that content.
Components.utils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
// Force the creation of an accessible for the hidden window's document.
let doc = Services.appShell.hiddenDOMWindow.document;
......
......@@ -17,7 +17,7 @@
<script type="application/javascript">
// Front end stuff sometimes likes to stuff things in the hidden window(s)
// in which case there's accessibles for that content.
Components.utils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
// Force the creation of an accessible for the hidden window's document.
let doc = Services.appShell.hiddenDOMWindow.document;
......
......@@ -27,7 +27,7 @@
const nsIDOMNSEditableElement =
Components.interfaces.nsIDOMNSEditableElement;
Components.utils.import("resource://gre/modules/InlineSpellChecker.jsm");
ChromeUtils.import("resource://gre/modules/InlineSpellChecker.jsm");
function spelledTextInvoker(aID) {
this.DOMNode = getNode(aID);
......
......@@ -5,7 +5,7 @@
var Ci = Components.interfaces;
var Cu = Components.utils;
Cu.import("resource://gre/modules/Geometry.jsm");
ChromeUtils.import("resource://gre/modules/Geometry.jsm");
var win = getMainChromeWindow(window);
......
......@@ -14,10 +14,10 @@ var gTestFuncs = [];
*/
var gIterator;
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/accessibility/Utils.jsm");
Components.utils.import("resource://gre/modules/accessibility/EventManager.jsm");
Components.utils.import("resource://gre/modules/accessibility/Gestures.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/accessibility/Utils.jsm");
ChromeUtils.import("resource://gre/modules/accessibility/EventManager.jsm");
ChromeUtils.import("resource://gre/modules/accessibility/Gestures.jsm");
var AccessFuTest = {
......@@ -139,7 +139,7 @@ var AccessFuTest = {
})();
// Start AccessFu and put it in stand-by.
Components.utils.import("resource://gre/modules/accessibility/AccessFu.jsm");
ChromeUtils.import("resource://gre/modules/accessibility/AccessFu.jsm");
AccessFu.attach(getMainChromeWindow(window));
......
var Cu = Components.utils;
const PREF_UTTERANCE_ORDER = "accessibility.accessfu.utterance";
Cu.import("resource://gre/modules/accessibility/Utils.jsm");
Cu.import("resource://gre/modules/accessibility/OutputGenerator.jsm", this);
ChromeUtils.import("resource://gre/modules/accessibility/Utils.jsm");
ChromeUtils.import("resource://gre/modules/accessibility/OutputGenerator.jsm", this);
/**
* Test context output generation.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment