Chromium Code Reviews| Index: remoting/webapp/remoting.js |
| diff --git a/remoting/webapp/remoting.js b/remoting/webapp/remoting.js |
| index c487fa1a666bad14a1ac285d72c4be1186b94216..78a9d5810819d77f0a3ef78b3a8b9379f2329954 100644 |
| --- a/remoting/webapp/remoting.js |
| +++ b/remoting/webapp/remoting.js |
| @@ -34,6 +34,8 @@ function consentRequired_(authContinue) { |
| * Entry point for app initialization. |
| */ |
| remoting.init = function() { |
| + migrateSettings_(); |
|
Wez
2013/04/04 18:51:40
nit: migrateLocalToChromeStorage_()?
Jamie
2013/04/04 19:23:39
Done.
|
| + |
| // TODO(jamiewalch): Remove this when we migrate to apps v2 |
| // (http://crbug.com/ 134213). |
| remoting.initMockStorage(); |
| @@ -356,3 +358,23 @@ function isWindowed_(callback) { |
| console.error('chome.tabs is not available.'); |
| } |
| } |
| + |
| +function migrateSettings_() { |
| + // The OAuth2 class still uses window.localStorage, so don't migrate any of |
| + // those settings. |
|
Wez
2013/04/04 18:51:40
nit: I'd suggest rewording to explain that we're m
Jamie
2013/04/04 19:23:39
I've added a doc comment to the function to explai
|
| + var oauthSettings = [ |
| + 'oauth2-refresh-token', |
| + 'oauth2-refresh-token-revokable', |
| + 'oauth2-access-token', |
| + 'oauth2-xsrf-token', |
| + 'remoting-email' |
| + ]; |
| + for (var setting in window.localStorage) { |
| + if (oauthSettings.indexOf(setting) == -1) { |
| + var copy = {} |
| + copy[setting] = window.localStorage.getItem(setting); |
| + chrome.storage.local.set(copy); |
|
Wez
2013/04/04 18:51:40
nit: You could collate the values to copy and do a
Jamie
2013/04/04 19:23:39
I don't think that would be any clearer.
|
| + window.localStorage.removeItem(setting); |
| + } |
| + } |
| +} |