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

Unified Diff: chrome/common/extensions/docs/examples/api/processes/process_monitor/popup.html

Issue 9289057: Changing manifest to v2 extension samples (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Adding zip files after rebasing with master Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/examples/api/processes/process_monitor/popup.html
diff --git a/chrome/common/extensions/docs/examples/api/processes/process_monitor/popup.html b/chrome/common/extensions/docs/examples/api/processes/process_monitor/popup.html
index 61e736b6780c4af86e657b9b608763c26a952723..dc6b5751c0d710934f06d65bf43c31e5825871e0 100644
--- a/chrome/common/extensions/docs/examples/api/processes/process_monitor/popup.html
+++ b/chrome/common/extensions/docs/examples/api/processes/process_monitor/popup.html
@@ -1,48 +1,6 @@
<html>
<head>
-<script>
- // Shows an updating list of process statistics.
- function init() {
- chrome.experimental.processes.onUpdated.addListener(function(processes) {
- var table = "<table>\n" +
- "<tr><td><b>Process</b></td>" +
- "<td>Type</td>" +
- "<td>CPU</td>" +
- "<td>Network</td>" +
- "<td>Shared Memory</td>" +
- "<td>Private Memory</td>" +
- "</tr>\n";
- for (pid in processes) {
- table = displayProcessInfo(processes[pid], table);
- }
- table += "</table>\n";
- var div = document.getElementById("process-list");
- div.innerHTML = table;
- });
- }
-
- function displayProcessInfo(process, table) {
- // Format network string like task manager
- var network = process.network;
- if (network > 1024) {
- network = (network / 1024).toFixed(1) + " kB/s";
- } else if (network > 0) {
- network += " B/s";
- } else if (network == -1) {
- network = "N/A";
- }
-
- table +=
- "<tr><td>" + process.id + "</td>" +
- "<td>" + process.type + "</td>" +
- "<td>" + process.cpu + "</td>" +
- "<td>" + network + "</td>" +
- "<td>" + (process.sharedMemory / 1024) + "K</td>" +
- "<td>" + (process.privateMemory / 1024) + "K</td>" +
- "</tr>\n";
- return table;
- }
-</script>
+<script src="popup.js"></script>
<style>
body {
overflow: hidden;
@@ -63,7 +21,7 @@ div, td {
}
</style>
</head>
-<body onload="init()">
+<body>
<div id="title"><b>Process Monitor</b></div>
<div id="process-list"><i>Loading...</i></div>
</body>

Powered by Google App Engine
This is Rietveld 408576698