Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(719)

Unified Diff: components/sync/driver/resources/about.js

Issue 2374913002: [USS] Show USS counters in about:sync page (Closed)
Patch Set: re-comments Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/sync/driver/proxy_data_type_controller.cc ('k') | components/sync/driver/sync_frontend.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f562c80cad194f0414c760751ccc173703e742fe 100644
--- a/components/sync/driver/resources/about.js
+++ b/components/sync/driver/resources/about.js
@@ -32,6 +32,24 @@ cr.define('chrome.sync.about_tab', function() {
refreshAboutInfo(e.details);
}
+ function onAboutInfoCountersUpdated(e) {
+ var details = e.details;
+
+ var modelType = details.modelType;
+ var counters = details.counters;
+
+ var type_status_array = chrome.sync.aboutInfo.type_status;
+ 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'));
+ }
+
/**
* Helper to determine if an element is scrolled to its bottom limit.
* @param {Element} elem element to check
@@ -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();
« no previous file with comments | « components/sync/driver/proxy_data_type_controller.cc ('k') | components/sync/driver/sync_frontend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698