Chromium Code Reviews| Index: components/sync/driver/resources/about.js |
| diff --git a/components/sync/driver/resources/about.js b/components/sync/driver/resources/about.js |
| index 47c1ab9392aa340da1810351a8a6ece4dc367342..4c072524b6d8d79d7e8060eb51d38c02d2d0d5e1 100644 |
| --- a/components/sync/driver/resources/about.js |
| +++ b/components/sync/driver/resources/about.js |
| @@ -28,6 +28,24 @@ cr.define('chrome.sync.about_tab', function() { |
| jstProcess(new JsEvalContext(aboutInfo), aboutInfoDiv); |
| } |
| + function onAboutInfoCountersUpdated(e) { |
|
pavely
2016/10/03 21:40:14
Could you move this function below onAboutInfoUpda
Gang Wu
2016/10/06 00:20:22
Done.
|
| + var details = e.details; |
| + |
| + var modelType = details.modelType; |
| + var counters = details.counters; |
| + |
| + var type_status_array = chrome.sync.aboutInfo.type_status; |
|
pavely
2016/10/03 21:40:14
onCountersUpdated can be called for different coun
Gang Wu
2016/10/06 00:20:22
I think it doesn't matter, just means update more.
|
| + type_status_array.forEach(function(row) { |
| + if (row.name == modelType) { |
| + row.num_entries = counters.numEntriesAndTombstones; |
| + row.num_live = counters.numEntries; |
| + } |
| + }); |
| + jstProcess( |
| + new JsEvalContext({ type_status: type_status_array }), |
| + $('typeInfo')); |
| + } |
| + |
| function onAboutInfoUpdatedEvent(e) { |
| refreshAboutInfo(e.details); |
| } |
| @@ -143,6 +161,10 @@ cr.define('chrome.sync.about_tab', function() { |
| 'onAboutInfoUpdated', |
| onAboutInfoUpdatedEvent); |
| + chrome.sync.events.removeEventListener( |
| + 'onCountersUpdated', |
| + onAboutInfoCountersUpdated); |
| + |
| var aboutInfo = JSON.parse(data); |
| refreshAboutInfo(aboutInfo); |
| }); |
| @@ -172,6 +194,10 @@ cr.define('chrome.sync.about_tab', function() { |
| 'onAboutInfoUpdated', |
| onAboutInfoUpdatedEvent); |
| + chrome.sync.events.addEventListener( |
| + 'onCountersUpdated', |
| + onAboutInfoCountersUpdated); |
| + |
| // Register to receive a stream of event notifications. |
| chrome.sync.registerForEvents(); |