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

Side by Side Diff: chrome/browser/resources/engagement/site_engagement.js

Issue 1407363010: Make table in chrome:site-engagement sortable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: go back to normal functions to please the almighty PRESUBMIT 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 define('main', [ 7 define('main', [
8 'mojo/public/js/connection', 8 'mojo/public/js/connection',
9 'chrome/browser/ui/webui/engagement/site_engagement.mojom', 9 'chrome/browser/ui/webui/engagement/site_engagement.mojom',
10 'content/public/renderer/service_provider', 10 'content/public/renderer/service_provider',
11 ], function(connection, siteEngagementMojom, serviceProvider) { 11 ], function(connection, siteEngagementMojom, serviceProvider) {
12 12
13 return function() { 13 return function() {
14 var uiHandler = connection.bindHandleToProxy( 14 var uiHandler = connection.bindHandleToProxy(
15 serviceProvider.connectToService( 15 serviceProvider.connectToService(
16 siteEngagementMojom.SiteEngagementUIHandler.name), 16 siteEngagementMojom.SiteEngagementUIHandler.name),
17 siteEngagementMojom.SiteEngagementUIHandler); 17 siteEngagementMojom.SiteEngagementUIHandler);
18 18
19 // Populate engagement table. 19 // Populate engagement table.
20 uiHandler.getSiteEngagementInfo().then(response => { 20 uiHandler.getSiteEngagementInfo().then(function(response) {
21 // Round each score to 2 decimal places.
22 response.info.forEach(function(x) {
23 x.score = Number(Math.round(x.score * 100) / 100);
24 });
21 $('engagement-table').engagementInfo = response.info; 25 $('engagement-table').engagementInfo = response.info;
22 }); 26 });
23 }; 27 };
24 }); 28 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/engagement/engagement_table.js ('k') | chrome/browser/ui/webui/engagement/site_engagement.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698