X-Git-Url: https://git.donarmstrong.com/dactyl.git?a=blobdiff_plain;f=common%2Fmodules%2Fservices.jsm;h=b586139418817f24e150305627303d096b5c024d;hb=247daf849abc85f4cfb10fa358c62c8daf8db95b;hp=315f95189531ef9bd5098dde994faa6693a8967f;hpb=354a049cce8415487552ce405cce167b7071fe1f;p=dactyl.git diff --git a/common/modules/services.jsm b/common/modules/services.jsm index 315f951..b586139 100644 --- a/common/modules/services.jsm +++ b/common/modules/services.jsm @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2013 Kris Maglione +// Copyright (c) 2008-2014 Kris Maglione // // This work is licensed for reuse under an MIT license. Details are // given in the LICENSE.txt file included with this file. @@ -39,7 +39,8 @@ var Services = Module("Services", { this.add("clipboardHelper", "@mozilla.org/widget/clipboardhelper;1", "nsIClipboardHelper"); this.add("commandLineHandler", "@mozilla.org/commandlinehandler/general-startup;1?type=dactyl"); this.add("console", "@mozilla.org/consoleservice;1", "nsIConsoleService"); - this.add("contentPrefs", "@mozilla.org/content-pref/service;1", "nsIContentPrefService"); + this.add("contentPrefs", "@mozilla.org/content-pref/service;1", ["nsIContentPrefService", + "nsIContentPrefService2"]); this.add("dactyl", "@dactyl.googlecode.com/extra/utils", "dactylIUtils"); this.add("dactyl:", this.PROTOCOL + "dactyl"); this.add("debugger", "@mozilla.org/js/jsd/debugger-service;1", "jsdIDebuggerService"); @@ -62,6 +63,7 @@ var Services = Module("Services", { this.add("mime", "@mozilla.org/mime;1", "nsIMIMEService"); this.add("observer", "@mozilla.org/observer-service;1", "nsIObserverService"); this.add("pref", "@mozilla.org/preferences-service;1", ["nsIPrefBranch2", "nsIPrefService"]); + this.add("printSettings", "@mozilla.org/gfx/printsettings-service;1", "nsIPrintSettingsService"); this.add("privateBrowsing", "@mozilla.org/privatebrowsing;1", "nsIPrivateBrowsingService"); this.add("profile", "@mozilla.org/toolkit/profile-service;1", "nsIToolkitProfileService"); this.add("resource:", this.PROTOCOL + "resource", ["nsIProtocolHandler", "nsIResProtocolHandler"]); @@ -183,7 +185,7 @@ var Services = Module("Services", { function () callable(XPCOMShim(this.interfaces)[this.init])); this[name] = (function Create() this._create(name, arguments)).bind(this); - update.apply(null, [this[name]].concat([Ci[i] for each (i in Array.concat(ifaces))])); + update.apply(null, [this[name]].concat([Ci[i] for (i of Array.concat(ifaces))])); return this[name]; }, @@ -206,7 +208,7 @@ var Services = Module("Services", { * * @param {string} name The service's cache key. */ - has: function has(name) Set.has(this.services, name) && this.services[name].class in Cc && + has: function has(name) hasOwnProperty(this.services, name) && this.services[name].class in Cc && this.services[name].interfaces.every(iface => iface in Ci) });