From 31873e39772c538cab418d03c244b4cac1addba0 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Mon, 27 Apr 2015 17:07:16 +0100 Subject: Remove all direct calls to Sync, stop exporting it This stops Sync from being referred to from anywhere except settings.coffee and settings_test.coffee. --- background_scripts/main.coffee | 2 +- background_scripts/settings.coffee | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index a13d9d98..edcdf3b2 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -744,5 +744,5 @@ chrome.windows.getAll { populate: true }, (windows) -> chrome.tabs.sendMessage(tab.id, { name: "getScrollPosition" }, createScrollPositionHandler()) # Start pulling changes from synchronized storage. -Sync.init() +Settings.init() showUpgradeMessage() diff --git a/background_scripts/settings.coffee b/background_scripts/settings.coffee index 81bc8589..44676ad7 100644 --- a/background_scripts/settings.coffee +++ b/background_scripts/settings.coffee @@ -14,7 +14,7 @@ # root = exports ? window -root.Sync = Sync = +Sync = storage: chrome.storage.sync doNotSync: ["settingsVersion", "previousVersion"] @@ -55,6 +55,7 @@ root.Sync = Sync = # root.Settings = Settings = + init: -> Sync.init() get: (key) -> if (key of localStorage) then JSON.parse(localStorage[key]) else @defaults[key] @@ -178,6 +179,9 @@ root.Settings = Settings = settingsVersion: Utils.getCurrentVersion() +# Export Sync via Settings for tests. +root.Settings.Sync = Sync + # We use settingsVersion to coordinate any necessary schema changes. if Utils.compareVersions("1.42", Settings.get("settingsVersion")) != -1 -- cgit v1.2.3