| OLD | NEW |
| 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 // Allow a function to be provided by tests, which will be called when | 7 // Allow a function to be provided by tests, which will be called when |
| 8 // the page has been populated with site engagement details. | 8 // the page has been populated with site engagement details. |
| 9 var resolvePageIsPopulated = null; | 9 var resolvePageIsPopulated = null; |
| 10 var pageIsPopulatedPromise = new Promise((resolve, reject) => { | 10 var pageIsPopulatedPromise = new Promise((resolve, reject) => { |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 /** | 200 /** |
| 201 * Retrieve site engagement info and render the engagement table. | 201 * Retrieve site engagement info and render the engagement table. |
| 202 */ | 202 */ |
| 203 function updateEngagementTable() { | 203 function updateEngagementTable() { |
| 204 // Populate engagement table. | 204 // Populate engagement table. |
| 205 uiHandler.getSiteEngagementDetails().then((response) => { | 205 uiHandler.getSiteEngagementDetails().then((response) => { |
| 206 info = response.info; | 206 info = response.info; |
| 207 renderTable(info); | 207 renderTable(info); |
| 208 resolvePageIsPopulated(); | 208 resolvePageIsPopulated(); |
| 209 }); | 209 }); |
| 210 }; | 210 } |
| 211 | 211 |
| 212 updateEngagementTable(); | 212 updateEngagementTable(); |
| 213 enableAutoupdate(); | 213 enableAutoupdate(); |
| 214 }; | 214 }; |
| 215 }); | 215 }); |
| OLD | NEW |