зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1132925 - Pass messages to the parent process to set reader mode prefs. r=margaret
This commit is contained in:
Родитель
94cb523c5c
Коммит
cf5e451b64
|
@ -28,6 +28,8 @@ let ReaderParent = {
|
|||
"Reader:Share",
|
||||
"Reader:SystemUIVisibility",
|
||||
"Reader:UpdateReaderButton",
|
||||
"Reader:SetIntPref",
|
||||
"Reader:SetCharPref",
|
||||
],
|
||||
|
||||
init: function() {
|
||||
|
@ -80,6 +82,18 @@ let ReaderParent = {
|
|||
this.updateReaderButton(browser);
|
||||
break;
|
||||
}
|
||||
case "Reader:SetIntPref": {
|
||||
if (message.data && message.data.name !== undefined) {
|
||||
Services.prefs.setIntPref(message.data.name, message.data.value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "Reader:SetCharPref": {
|
||||
if (message.data && message.data.name !== undefined) {
|
||||
Services.prefs.setCharPref(message.data.name, message.data.value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -301,7 +301,10 @@ AboutReader.prototype = {
|
|||
this._fontSize = newFontSize;
|
||||
htmlClasses.add("font-size" + this._fontSize);
|
||||
|
||||
Services.prefs.setIntPref("reader.font_size", this._fontSize);
|
||||
this._mm.sendAsyncMessage("Reader:SetIntPref", {
|
||||
name: "reader.font_size",
|
||||
value: this._fontSize
|
||||
});
|
||||
},
|
||||
|
||||
_handleDeviceLight: function Reader_handleDeviceLight(newLux) {
|
||||
|
@ -392,7 +395,10 @@ AboutReader.prototype = {
|
|||
this._enableAmbientLighting(colorSchemePref === "auto");
|
||||
this._setColorScheme(colorSchemePref);
|
||||
|
||||
Services.prefs.setCharPref("reader.color_scheme", colorSchemePref);
|
||||
this._mm.sendAsyncMessage("Reader:SetCharPref", {
|
||||
name: "reader.color_scheme",
|
||||
value: colorSchemePref
|
||||
});
|
||||
},
|
||||
|
||||
_setFontType: function Reader_setFontType(newFontType) {
|
||||
|
@ -407,7 +413,10 @@ AboutReader.prototype = {
|
|||
this._fontType = newFontType;
|
||||
bodyClasses.add(this._fontType);
|
||||
|
||||
Services.prefs.setCharPref("reader.font_type", this._fontType);
|
||||
this._mm.sendAsyncMessage("Reader:SetCharPref", {
|
||||
name: "reader.font_type",
|
||||
value: this._fontType
|
||||
});
|
||||
},
|
||||
|
||||
_getToolbarVisibility: function Reader_getToolbarVisibility() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче