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

Unified Diff: chrome/browser/resources/engagement/site_engagement.js

Issue 1454603002: Update data in chrome://site-engagement periodically. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/engagement/site_engagement.js
diff --git a/chrome/browser/resources/engagement/site_engagement.js b/chrome/browser/resources/engagement/site_engagement.js
index 22cef9c1183daf28520f3a5b20fe46a981b367da..38451293f51077ed0dd7b53263476c81ff9e9e51 100644
--- a/chrome/browser/resources/engagement/site_engagement.js
+++ b/chrome/browser/resources/engagement/site_engagement.js
@@ -9,20 +9,24 @@ define('main', [
'chrome/browser/ui/webui/engagement/site_engagement.mojom',
'content/public/renderer/service_provider',
], function(connection, siteEngagementMojom, serviceProvider) {
-
return function() {
var uiHandler = connection.bindHandleToProxy(
serviceProvider.connectToService(
siteEngagementMojom.SiteEngagementUIHandler.name),
siteEngagementMojom.SiteEngagementUIHandler);
- // Populate engagement table.
- uiHandler.getSiteEngagementInfo().then(function(response) {
- // Round each score to 2 decimal places.
- response.info.forEach(function(x) {
- x.score = Number(Math.round(x.score * 100) / 100);
+ var updateEngagementTable = function() {
+ // Populate engagement table.
+ uiHandler.getSiteEngagementInfo().then(function(response) {
+ // Round each score to 2 decimal places.
+ response.info.forEach(function(x) {
+ x.score = Number(Math.round(x.score * 100) / 100);
+ });
+ $('engagement-table').engagementInfo = response.info;
});
- $('engagement-table').engagementInfo = response.info;
- });
+
+ setTimeout(updateEngagementTable, 2000);
+ };
+ updateEngagementTable();
};
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698