Backed out changeset 32d1752fb7ba (bug 786095)

This commit is contained in:
Jared Wein 2012-09-24 16:03:59 -07:00
parent ff540847c2
commit a1824208ff
3 changed files with 3 additions and 15 deletions

View File

@ -80,10 +80,6 @@ let SocialUI = {
let accesskey = gNavigatorBundle.getString("social.toggle.accesskey"); let accesskey = gNavigatorBundle.getString("social.toggle.accesskey");
toggleCommand.setAttribute("label", label); toggleCommand.setAttribute("label", label);
toggleCommand.setAttribute("accesskey", accesskey); toggleCommand.setAttribute("accesskey", accesskey);
// Override the normal 'checked' state set by updateToggleCommand
// when in safe mode so the feature can be disabled.
if (Services.appinfo.inSafeMode)
toggleCommand.setAttribute("checked", Services.prefs.getBoolPref("social.enabled"));
SocialToolbar.init(); SocialToolbar.init();
SocialShareButton.init(); SocialShareButton.init();

View File

@ -19,10 +19,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "SocialService",
let Social = { let Social = {
lastEventReceived: 0, lastEventReceived: 0,
provider: null, provider: null,
_disabledForSafeMode: false,
init: function Social_init(callback) { init: function Social_init(callback) {
this._disabledForSafeMode = Services.appinfo.inSafeMode && this.enabled;
if (this.provider) { if (this.provider) {
schedule(callback); schedule(callback);
return; return;
@ -57,8 +54,7 @@ let Social = {
}, },
toggle: function Social_toggle() { toggle: function Social_toggle() {
this.enabled = this._disabledForSafeMode ? true : !this.enabled; this.enabled = !this.enabled;
this._disabledForSafeMode = false;
}, },
toggleSidebar: function SocialSidebar_toggle() { toggleSidebar: function SocialSidebar_toggle() {

View File

@ -63,7 +63,7 @@ XPCOMUtils.defineLazyGetter(SocialServiceInternal, "providers", function () {
try { try {
var manifest = JSON.parse(MANIFEST_PREFS.getCharPref(pref)); var manifest = JSON.parse(MANIFEST_PREFS.getCharPref(pref));
if (manifest && typeof(manifest) == "object") { if (manifest && typeof(manifest) == "object") {
let provider = new SocialProvider(manifest, Services.appinfo.inSafeMode ? false : SocialServiceInternal.enabled); let provider = new SocialProvider(manifest, SocialServiceInternal.enabled);
providers[provider.origin] = provider; providers[provider.origin] = provider;
} }
} catch (err) { } catch (err) {
@ -86,11 +86,7 @@ const SocialService = {
}, },
set enabled(val) { set enabled(val) {
let enable = !!val; let enable = !!val;
if (enable == SocialServiceInternal.enabled)
// Allow setting to the same value when in safe mode so the
// feature can be force enabled.
if (enable == SocialServiceInternal.enabled &&
!Services.appinfo.inSafeMode)
return; return;
Services.prefs.setBoolPref("social.enabled", enable); Services.prefs.setBoolPref("social.enabled", enable);