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

Side by Side Diff: components/webapks_ui/resources/about_webapks.js

Issue 2629573004: Add a chrome://webapks page. (Closed)
Patch Set: Adds an about:webapks page with information about all installed Web APKs on the device Created 3 years, 11 months 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
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
hartmanng 2017/01/13 15:40:22 s/(c) 2011/2017/
gonzalon 2017/01/13 20:24:40 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * Creates and returns a text node (with |text| as content) wrapped around a <b>
7 * tag and assigning it the |className| class.
8 */
9 function boldedTextNode(text, className) {
pkotwicz 2017/01/13 17:00:59 Can you instead: Call createElementWithClassName()
gonzalon 2017/01/13 20:24:40 Done.
10 var node = document.createElement("B");
11 node.appendChild(document.createTextNode(text));
pkotwicz 2017/01/13 17:00:59 Can you set the text by setting node.textContent ?
gonzalon 2017/01/13 20:24:40 Done.
12 node.className = className;
13 return node;
14 }
15
16 /**
17 * Callback from the backend with the information of a Web APK to display.
18 * This will be called once for each web APK available on the device and each
pkotwicz 2017/01/13 17:00:59 "web APK" -> WebAPK
gonzalon 2017/01/13 20:24:40 Done.
19 * one will be appended at the end of the other.
20 */
21 function returnWebAPKsInfo(appName, packageName, shellApkVersion, versionCode) {
pkotwicz 2017/01/13 17:00:59 Can this function be called just once with the inf
gonzalon 2017/01/13 20:24:40 From what I understood, the history page works a b
22 var webApksList = $('webapks-list');
23
24 webApksList.appendChild(document.createElement("BR"));
25 webApksList.appendChild(document.createElement("BR"));
26 webApksList.appendChild(boldedTextNode(appName, "app-name"));
27
28 webApksList.appendChild(document.createElement("BR"));
29 webApksList.appendChild(boldedTextNode(
30 loadTimeData.getString('packageName'), "app-property-label"));
31 webApksList.appendChild(document.createTextNode(packageName));
32
33 webApksList.appendChild(document.createElement("BR"));
34 webApksList.appendChild(boldedTextNode(
35 loadTimeData.getString('shellApkVersion'), "app-property-label"));
36 webApksList.appendChild(document.createTextNode(shellApkVersion));
37
38 webApksList.appendChild(document.createElement("BR"));
39 webApksList.appendChild(boldedTextNode(
40 loadTimeData.getString('versionCode'), "app-property-label"));
41 webApksList.appendChild(document.createTextNode(versionCode));
42 }
43
44 /* All the work we do onload. */
45 function onLoadWork() {
46 chrome.send('requestWebAPKsInfo');
47 }
48
49 document.addEventListener('DOMContentLoaded', onLoadWork);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698