diff --git a/webapprt/WebappRTDirectoryProvider.js b/webapprt/WebappRTDirectoryProvider.js index c4ae8ac6867..08f857ab7b1 100644 --- a/webapprt/WebappRTDirectoryProvider.js +++ b/webapprt/WebappRTDirectoryProvider.js @@ -7,7 +7,9 @@ const Ci = Components.interfaces; const Cu = Components.utils; const WEBAPP_REGISTRY_DIR = "WebappRegD"; +const NS_APP_CHROME_DIR_LIST = "AChromDL"; +Cu.import("resource://gre/modules/FileUtils.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/WebappRT.jsm"); @@ -16,7 +18,8 @@ function DirectoryProvider() {} DirectoryProvider.prototype = { classID: Components.ID("{e1799fda-4b2f-4457-b671-e0641d95698d}"), - QueryInterface: XPCOMUtils.generateQI([Ci.nsIDirectoryServiceProvider]), + QueryInterface: XPCOMUtils.generateQI([Ci.nsIDirectoryServiceProvider, + Ci.nsIDirectoryServiceProvider2]), getFile: function(prop, persistent) { if (prop == WEBAPP_REGISTRY_DIR) { @@ -28,7 +31,25 @@ DirectoryProvider.prototype = { // We return null to show failure instead of throwing an error, // which works with the way the interface is called (per bug 529077). return null; - } + }, + + getFiles: function(prop, persistent) { + if (prop == NS_APP_CHROME_DIR_LIST) { + return { + _done: false, + QueryInterface: XPCOMUtils.generateQI([Ci.nsISimpleEnumerator]), + hasMoreElements: function() { + return !this._done; + }, + getNext: function() { + this._done = true; + return FileUtils.getDir("AppRegD", ["chrome"], false); + } + }; + } + + return null; + }, }; const NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]);