Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: safari/ext/background.js

Issue 29332926: Issue 3446 - Remove code migrating prefs and files to chrome.storage (Closed)
Patch Set: Created Dec. 21, 2015, 2:48 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/prefs.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: safari/ext/background.js
===================================================================
--- a/safari/ext/background.js
+++ b/safari/ext/background.js
@@ -722,58 +722,7 @@
if (callback)
setTimeout(callback, 0);
},
- onChanged: new ext._EventTarget(),
-
- // Preferences were previously encoded as JSON for compatibility
- // with localStorage, which has been used on Chrome.
- migratePrefs: function(hooks)
- {
- var settings = safari.extension.settings;
-
- for (var key in settings)
- {
- var item = hooks.map(key, settings[key]);
-
- if (item)
- {
- delete settings[key];
- settings[item.key] = item.value;
- }
- }
-
- hooks.done();
- },
-
- // While moving away from the FileSystem API on Chrome the data structure
- // for files on Safari changed as well, in order to keep thing consistent.
- migrateFiles: function(callback)
- {
- var settings = safari.extension.settings;
-
- for (var key in settings)
- {
- var match = key.match(/^(.*)\/lastModified$/)
-
- if (match)
- {
- var filename = match[1];
- var content = settings[filename];
-
- if (typeof content == "string")
- {
- settings["file:" + filename] = {
- content: content.split(/[\r\n]+/),
- lastModified: settings[key]
- };
-
- delete settings[key];
- delete settings[filename];
- }
- }
- }
-
- callback();
- }
+ onChanged: new ext._EventTarget()
};
safari.extension.settings.addEventListener("change", function(event)
« no previous file with comments | « lib/prefs.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld