Chromium Code Reviews| Index: chrome/browser/resources/sync_internals/about.js |
| diff --git a/chrome/browser/resources/sync_internals/about.js b/chrome/browser/resources/sync_internals/about.js |
| index 7136b903431dbdb7f432ec6916df45c363407b54..1c5943e641ceb2dc8ae2cc46a833ea69fe339c1b 100644 |
| --- a/chrome/browser/resources/sync_internals/about.js |
| +++ b/chrome/browser/resources/sync_internals/about.js |
| @@ -22,23 +22,24 @@ function highlightIfChanged(node, oldVal, newVal) { |
| // Contains the latest snapshot of sync about info. |
| chrome.sync.aboutInfo = {}; |
| -// TODO(akalin): Make aboutInfo have key names likeThis and not |
| -// like_this. |
| function refreshAboutInfo(aboutInfo) { |
| chrome.sync.aboutInfo = aboutInfo; |
| var aboutInfoDiv = $('aboutInfo'); |
| jstProcess(new JsEvalContext(aboutInfo), aboutInfoDiv); |
| } |
| +function onAboutInfoUpdatedEvent(e) { |
| + var aboutInfo = e.details; |
| + refreshAboutInfo(aboutInfo); |
|
Dan Beam
2014/02/13 22:32:45
nit: refreshAboutInfo(e.details);
rlarocque
2014/02/13 23:34:30
Done.
|
| +} |
| + |
| function onLoad() { |
| $('status-data').hidden = true; |
| - chrome.sync.getAboutInfo(refreshAboutInfo); |
| chrome.sync.events.addEventListener( |
| - 'onServiceStateChanged', |
| - function(e) { |
| - chrome.sync.getAboutInfo(refreshAboutInfo); |
| - }); |
| + 'onAboutInfoUpdated', |
| + onAboutInfoUpdatedEvent); |
| + chrome.sync.requestUpdatedAboutInfo(); |
| var dumpStatusButton = $('dump-status'); |
| dumpStatusButton.addEventListener('click', function(event) { |
| @@ -78,8 +79,8 @@ function onLoad() { |
| // Remove listeners to prevent sync events from overwriting imported data. |
| chrome.sync.events.removeEventListener( |
| - 'onServiceStateChanged', |
| - refreshAboutInfo); |
| + 'onAboutInfoUpdated', |
| + onAboutInfoUpdatedEvent); |
| var aboutInfo = JSON.parse(data); |
| refreshAboutInfo(aboutInfo); |