diff options
Diffstat (limited to 'chromium/chrome/browser/resources/webapks')
3 files changed, 12 insertions, 20 deletions
diff --git a/chromium/chrome/browser/resources/webapks/BUILD.gn b/chromium/chrome/browser/resources/webapks/BUILD.gn index 6e4c0a57cda..2a502903daa 100644 --- a/chromium/chrome/browser/resources/webapks/BUILD.gn +++ b/chromium/chrome/browser/resources/webapks/BUILD.gn @@ -12,9 +12,8 @@ js_type_check("closure_compile") { js_library("about_webapks") { deps = [ - "//ui/webui/resources/js:cr", - "//ui/webui/resources/js:load_time_data", - "//ui/webui/resources/js:util", + "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:util.m", ] externs_list = [ "$externs_path/chrome_send.js" ] } diff --git a/chromium/chrome/browser/resources/webapks/about_webapks.html b/chromium/chrome/browser/resources/webapks/about_webapks.html index f09ce2c5d08..4e91c526f30 100644 --- a/chromium/chrome/browser/resources/webapks/about_webapks.html +++ b/chromium/chrome/browser/resources/webapks/about_webapks.html @@ -11,12 +11,8 @@ about:webapks template page <title>About WebAPKs</title> <link rel="stylesheet" href="chrome://resources/css/text_defaults.css"> <link rel="stylesheet" href="about_webapks.css"> - <link rel="import" href="chrome://resources/html/cr.html"> - <link rel="import" href="chrome://resources/html/load_time_data.html"> - <link rel="import" href="chrome://resources/html/util.html"> - <script src="chrome://webapks/webapks.js"></script> - <script src="chrome://webapks/strings.js"></script> + <script type="module" src="webapks.js"></script> </head> <body> 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'); }); |