Bug 885357 - Migrate "plugins.click_to_play" pref to "plugin.default.state" on upgrade. r=wesj

This commit is contained in:
Margaret Leibovic 2013-06-21 20:36:32 -07:00
parent 050371bcb9
commit a9a13fce6a
2 changed files with 10 additions and 0 deletions

View File

@ -444,6 +444,9 @@ pref("browser.ui.show-margins-threshold", 20);
pref("plugin.disable", false);
pref("dom.ipc.plugins.enabled", false);
// This pref isn't actually used anymore, but we're leaving this here to avoid changing
// the default so that we can migrate a user-set pref. See bug 885357.
pref("plugins.click_to_play", true);
// The default value for nsIPluginTag.enabledState (STATE_CLICKTOPLAY = 1)
pref("plugin.default.state", 1);

View File

@ -613,6 +613,13 @@ var BrowserApp = {
// initialize the form history and passwords databases on upgrades
Services.obs.notifyObservers(null, "FormHistory:Init", "");
Services.obs.notifyObservers(null, "Passwords:Init", "");
// Migrate user-set "plugins.click_to_play" pref. See bug 884694.
// Because the default value is true, a user-set pref means that the pref was set to false.
if (Services.prefs.prefHasUserValue("plugins.click_to_play")) {
Services.prefs.setIntPref("plugin.default.state", Ci.nsIPluginTag.STATE_ENABLED);
Services.prefs.clearUserPref("plugins.click_to_play");
}
},
shutdown: function shutdown() {