summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/webapks/about_webapks.js
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/resources/webapks/about_webapks.js')
-rw-r--r--chromium/chrome/browser/resources/webapks/about_webapks.js21
1 files changed, 9 insertions, 12 deletions
diff --git a/chromium/chrome/browser/resources/webapks/about_webapks.js b/chromium/chrome/browser/resources/webapks/about_webapks.js
index b21be02901e..10bc849c424 100644
--- a/chromium/chrome/browser/resources/webapks/about_webapks.js
+++ b/chromium/chrome/browser/resources/webapks/about_webapks.js
@@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+import './strings.m.js';
+
+import {addWebUIListener} from 'chrome://resources/js/cr.m.js';
+import {$, createElementWithClassName} from 'chrome://resources/js/util.m.js';
+
/**
* @typedef {{
* name: string,
@@ -54,17 +59,6 @@ function createElementWithTextAndClass(text, type, className) {
}
/**
- * Callback from the backend with the information of a WebAPK to display.
- * This will be called once per WebAPK.
- *
- * @param {!WebApkInfo} webApkInfo Object with information about an
- * installed WebAPK.
- */
-function returnWebApkInfo(webApkInfo) {
- addWebApk(webApkInfo);
-}
-
-/**
* @param {HTMLElement} webApkList List of elements which contain WebAPK
* attributes.
* @param {string} label Text that identifies the new element.
@@ -96,7 +90,7 @@ function addWebApkButton(webApkList, text, callback) {
/**
* Adds a new entry to the page with the information of a WebAPK.
*
- * @param {WebApkInfo} webApkInfo Information about an installed WebAPK.
+ * @param {!WebApkInfo} webApkInfo Information about an installed WebAPK.
*/
function addWebApk(webApkInfo) {
/** @type {HTMLElement} */ const webApkList = $('webapk-list');
@@ -160,5 +154,8 @@ function addWebApk(webApkInfo) {
}
document.addEventListener('DOMContentLoaded', function() {
+ // Add a WebUI listener for the 'web-apk-info' event emmitted from the
+ // backend. This will be triggered once per WebAPK.
+ addWebUIListener('web-apk-info', addWebApk);
chrome.send('requestWebApksInfo');
});