Bug 1249574 - send the notification about synced tab state changing as the tabs engine is enabled or disabled. r=rnewman

This commit is contained in:
Mark Hammond 2016-03-03 12:20:41 +11:00
parent 036b65c922
commit 668c9ba887

View File

@ -208,6 +208,9 @@ let SyncedTabsInternal = {
Preferences.reset("services.sync.lastTabFetch");
Services.obs.notifyObservers(null, TOPIC_TABS_CHANGED, null);
break;
case "nsPref:changed":
Services.obs.notifyObservers(null, TOPIC_TABS_CHANGED, null);
break;
default:
break;
}
@ -232,6 +235,10 @@ let SyncedTabsInternal = {
Services.obs.addObserver(SyncedTabsInternal, "weave:engine:sync:finish", false);
Services.obs.addObserver(SyncedTabsInternal, "weave:service:start-over", false);
// Observe the pref the indicates the state of the tabs engine has changed.
// This will force consumers to re-evaluate the state of sync and update
// accordingly.
Services.prefs.addObserver("services.sync.engine.tabs", SyncedTabsInternal, false);
// The public interface.
this.SyncedTabs = {