]> git.donarmstrong.com Git - dactyl.git/blobdiff - common/modules/services.jsm
Imported Upstream version 1.1+hg7904
[dactyl.git] / common / modules / services.jsm
index 315f95189531ef9bd5098dde994faa6693a8967f..b586139418817f24e150305627303d096b5c024d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2013 Kris Maglione <maglione.k at Gmail>
+// Copyright (c) 2008-2014 Kris Maglione <maglione.k at Gmail>
 //
 // 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)
 });