Bug 746121 - Updating the DirectoryProvider to look for user.js on the sdcard. r=vingtetun a=b2g-only

This commit is contained in:
Etienne Segonzac 2012-04-18 12:47:05 +02:00
parent abc9432192
commit dc2493ecb9

View File

@ -10,23 +10,24 @@ const Cr = Components.results;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
const OFFLINE_PROFILE_DIR = "/data/local"
const LOCAL_DIR = "/data/local";
function DirectoryProvider() {
}
DirectoryProvider.prototype = {
classID: Components.ID("{9181eb7c-6f87-11e1-90b1-4f59d80dd2e5}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDirectoryServiceProvider]),
getFile: function dp_getFile(prop, persistent) {
#ifdef MOZ_WIDGET_GONK
if (prop == "cachePDir" || prop == "webappsDir") {
let localProps = ["cachePDir", "webappsDir", "PrefD"];
if (localProps.indexOf(prop) != -1) {
prop.persistent = true;
let file = Cc["@mozilla.org/file/local;1"]
.createInstance(Ci.nsILocalFile)
file.initWithPath(OFFLINE_PROFILE_DIR);
file.initWithPath(LOCAL_DIR);
return file;
}
#endif