Bug 829456 - Update browser-fullZoom.js to use nsIContentPrefService2. r=mak
This commit is contained in:
@@ -195,8 +195,8 @@ ContentPrefService2.prototype = {
|
||||
if (context && context.usePrivateBrowsing) {
|
||||
this._pbStore.set(group, name, value);
|
||||
this._schedule(function () {
|
||||
this._cps._broadcastPrefSet(group, name, value);
|
||||
cbHandleCompletion(callback, Ci.nsIContentPrefCallback2.COMPLETE_OK);
|
||||
this._cps._broadcastPrefSet(group, name, value);
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -258,11 +258,11 @@ ContentPrefService2.prototype = {
|
||||
|
||||
this._execStmts(stmts, {
|
||||
onDone: function onDone(reason, ok) {
|
||||
if (ok) {
|
||||
if (ok)
|
||||
this._cache.setWithCast(group, name, value);
|
||||
this._cps._broadcastPrefSet(group, name, value);
|
||||
}
|
||||
cbHandleCompletion(callback, reason);
|
||||
if (ok)
|
||||
this._cps._broadcastPrefSet(group, name, value);
|
||||
},
|
||||
onError: function onError(nsresult) {
|
||||
cbHandleError(callback, nsresult);
|
||||
@@ -342,11 +342,13 @@ ContentPrefService2.prototype = {
|
||||
this._pbStore.remove(sgroup, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
cbHandleCompletion(callback, reason);
|
||||
if (ok) {
|
||||
for (let [sgroup, , ] in prefs) {
|
||||
this._cps._broadcastPrefRemoved(sgroup, name);
|
||||
}
|
||||
}
|
||||
cbHandleCompletion(callback, reason);
|
||||
},
|
||||
onError: function onError(nsresult) {
|
||||
cbHandleError(callback, nsresult);
|
||||
@@ -421,18 +423,18 @@ ContentPrefService2.prototype = {
|
||||
this._cache.set(grp, name, undefined);
|
||||
},
|
||||
onDone: function onDone(reason, ok) {
|
||||
if (ok) {
|
||||
if (context && context.usePrivateBrowsing) {
|
||||
for (let [sgroup, sname, ] in this._pbStore) {
|
||||
prefs.set(sgroup, sname);
|
||||
this._pbStore.remove(sgroup, sname);
|
||||
}
|
||||
if (ok && context && context.usePrivateBrowsing) {
|
||||
for (let [sgroup, sname, ] in this._pbStore) {
|
||||
prefs.set(sgroup, sname);
|
||||
this._pbStore.remove(sgroup, sname);
|
||||
}
|
||||
}
|
||||
cbHandleCompletion(callback, reason);
|
||||
if (ok) {
|
||||
for (let [sgroup, sname, ] in prefs) {
|
||||
this._cps._broadcastPrefRemoved(sgroup, sname);
|
||||
}
|
||||
}
|
||||
cbHandleCompletion(callback, reason);
|
||||
},
|
||||
onError: function onError(nsresult) {
|
||||
cbHandleError(callback, nsresult);
|
||||
@@ -473,18 +475,18 @@ ContentPrefService2.prototype = {
|
||||
this._cache.set(grp, name, undefined);
|
||||
},
|
||||
onDone: function onDone(reason, ok) {
|
||||
if (ok) {
|
||||
if (context && context.usePrivateBrowsing) {
|
||||
for (let [sgroup, sname, ] in this._pbStore) {
|
||||
prefs.set(sgroup, sname);
|
||||
}
|
||||
this._pbStore.removeGrouped();
|
||||
if (ok && context && context.usePrivateBrowsing) {
|
||||
for (let [sgroup, sname, ] in this._pbStore) {
|
||||
prefs.set(sgroup, sname);
|
||||
}
|
||||
this._pbStore.removeGrouped();
|
||||
}
|
||||
cbHandleCompletion(callback, reason);
|
||||
if (ok) {
|
||||
for (let [sgroup, sname, ] in prefs) {
|
||||
this._cps._broadcastPrefRemoved(sgroup, sname);
|
||||
}
|
||||
}
|
||||
cbHandleCompletion(callback, reason);
|
||||
},
|
||||
onError: function onError(nsresult) {
|
||||
cbHandleError(callback, nsresult);
|
||||
@@ -544,20 +546,20 @@ ContentPrefService2.prototype = {
|
||||
this._cache.set(grp, name, undefined);
|
||||
},
|
||||
onDone: function onDone(reason, ok) {
|
||||
if (ok) {
|
||||
if (context && context.usePrivateBrowsing) {
|
||||
for (let [sgroup, sname, ] in this._pbStore) {
|
||||
if (sname === name) {
|
||||
prefs.set(sgroup, name);
|
||||
this._pbStore.remove(sgroup, name);
|
||||
}
|
||||
if (ok && context && context.usePrivateBrowsing) {
|
||||
for (let [sgroup, sname, ] in this._pbStore) {
|
||||
if (sname === name) {
|
||||
prefs.set(sgroup, name);
|
||||
this._pbStore.remove(sgroup, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
cbHandleCompletion(callback, reason);
|
||||
if (ok) {
|
||||
for (let [sgroup, , ] in prefs) {
|
||||
this._cps._broadcastPrefRemoved(sgroup, name);
|
||||
}
|
||||
}
|
||||
cbHandleCompletion(callback, reason);
|
||||
},
|
||||
onError: function onError(nsresult) {
|
||||
cbHandleError(callback, nsresult);
|
||||
@@ -682,6 +684,10 @@ ContentPrefService2.prototype = {
|
||||
this._cps.removeObserver(name, observer);
|
||||
},
|
||||
|
||||
extractDomain: function CPS2_extractDomain(str) {
|
||||
return this._parseGroup(str);
|
||||
},
|
||||
|
||||
/**
|
||||
* Tests use this as a backchannel by calling it directly.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user