summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/docs/examples/api
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-11-01 12:19:54 +0000
committerIain Merrick <husky@google.com>2010-11-03 10:21:10 +0000
commit731df977c0511bca2206b5f333555b1205ff1f43 (patch)
tree0e750b949b3f00a1ac11fda25d3c2de512f2b465 /chrome/common/extensions/docs/examples/api
parent5add15e10e7bb80512f2c597ca57221314abe577 (diff)
downloadexternal_chromium-731df977c0511bca2206b5f333555b1205ff1f43.zip
external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.tar.gz
external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.tar.bz2
Merge Chromium at r63472 : Initial merge by git.
Change-Id: Ifb9ee821af006a5f2211e81471be93ae440a1f5a
Diffstat (limited to 'chrome/common/extensions/docs/examples/api')
-rw-r--r--chrome/common/extensions/docs/examples/api/bookmarks/basic.zipbin5647 -> 5647 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/browserAction/make_page_red.zipbin3930 -> 3930 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/browserAction/print.zipbin1614 -> 1614 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/browserAction/set_icon_path.zipbin15530 -> 15530 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/browserAction/set_page_color.zipbin5245 -> 5245 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/contextMenus/basic.zipbin3512 -> 3512 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/cookies.zipbin9255 -> 9255 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/history/showHistory.zipbin9608 -> 9608 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/i18n/cld.zipbin1310 -> 1310 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/i18n/getMessage.zipbin6739 -> 6739 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/idle/idle_simple.zipbin11992 -> 11992 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/infobars/sandwichbar.zipbin16055 -> 16055 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/messaging/timer.zipbin3558 -> 3558 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/notifications.zipbin49949 -> 49949 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/omnibox.zipbin1101 -> 1101 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/override/blank_ntp.zipbin699 -> 699 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/override/override_igoogle.zipbin496 -> 496 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/pageAction/pageaction_by_content.zipbin14181 -> 14181 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/pageAction/pageaction_by_url.zipbin15175 -> 15175 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/pageAction/set_icon.zipbin8421 -> 8421 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/processes/process_monitor/icon.pngbin0 -> 2809 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/processes/process_monitor/manifest.json13
-rw-r--r--chrome/common/extensions/docs/examples/api/processes/process_monitor/popup.html70
-rw-r--r--chrome/common/extensions/docs/examples/api/processes/show_tabs.zipbin6137 -> 6137 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/processes/show_tabs/popup.html14
-rw-r--r--chrome/common/extensions/docs/examples/api/tabs/inspector.zipbin46521 -> 46521 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/tabs/screenshot.zipbin6202 -> 6202 bytes
-rw-r--r--chrome/common/extensions/docs/examples/api/windows/merge_windows.zipbin12134 -> 12134 bytes
28 files changed, 90 insertions, 7 deletions
diff --git a/chrome/common/extensions/docs/examples/api/bookmarks/basic.zip b/chrome/common/extensions/docs/examples/api/bookmarks/basic.zip
index 7460329..fddc7df 100644
--- a/chrome/common/extensions/docs/examples/api/bookmarks/basic.zip
+++ b/chrome/common/extensions/docs/examples/api/bookmarks/basic.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/browserAction/make_page_red.zip b/chrome/common/extensions/docs/examples/api/browserAction/make_page_red.zip
index ac58aa1..aab9498 100644
--- a/chrome/common/extensions/docs/examples/api/browserAction/make_page_red.zip
+++ b/chrome/common/extensions/docs/examples/api/browserAction/make_page_red.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/browserAction/print.zip b/chrome/common/extensions/docs/examples/api/browserAction/print.zip
index 95c9329..bf50d51 100644
--- a/chrome/common/extensions/docs/examples/api/browserAction/print.zip
+++ b/chrome/common/extensions/docs/examples/api/browserAction/print.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/browserAction/set_icon_path.zip b/chrome/common/extensions/docs/examples/api/browserAction/set_icon_path.zip
index f424d96..47b69c5 100644
--- a/chrome/common/extensions/docs/examples/api/browserAction/set_icon_path.zip
+++ b/chrome/common/extensions/docs/examples/api/browserAction/set_icon_path.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/browserAction/set_page_color.zip b/chrome/common/extensions/docs/examples/api/browserAction/set_page_color.zip
index e76e94b..9f2691f 100644
--- a/chrome/common/extensions/docs/examples/api/browserAction/set_page_color.zip
+++ b/chrome/common/extensions/docs/examples/api/browserAction/set_page_color.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/contextMenus/basic.zip b/chrome/common/extensions/docs/examples/api/contextMenus/basic.zip
index 443d83b..3e505f9 100644
--- a/chrome/common/extensions/docs/examples/api/contextMenus/basic.zip
+++ b/chrome/common/extensions/docs/examples/api/contextMenus/basic.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/cookies.zip b/chrome/common/extensions/docs/examples/api/cookies.zip
index edd8163..a02c566 100644
--- a/chrome/common/extensions/docs/examples/api/cookies.zip
+++ b/chrome/common/extensions/docs/examples/api/cookies.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/history/showHistory.zip b/chrome/common/extensions/docs/examples/api/history/showHistory.zip
index 970cf68..f347d0c 100644
--- a/chrome/common/extensions/docs/examples/api/history/showHistory.zip
+++ b/chrome/common/extensions/docs/examples/api/history/showHistory.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/i18n/cld.zip b/chrome/common/extensions/docs/examples/api/i18n/cld.zip
index f809b4b..5cf6424 100644
--- a/chrome/common/extensions/docs/examples/api/i18n/cld.zip
+++ b/chrome/common/extensions/docs/examples/api/i18n/cld.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/i18n/getMessage.zip b/chrome/common/extensions/docs/examples/api/i18n/getMessage.zip
index a67a0ae..9dab5b0 100644
--- a/chrome/common/extensions/docs/examples/api/i18n/getMessage.zip
+++ b/chrome/common/extensions/docs/examples/api/i18n/getMessage.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/idle/idle_simple.zip b/chrome/common/extensions/docs/examples/api/idle/idle_simple.zip
index ff33a9a..b8d1b1d 100644
--- a/chrome/common/extensions/docs/examples/api/idle/idle_simple.zip
+++ b/chrome/common/extensions/docs/examples/api/idle/idle_simple.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/infobars/sandwichbar.zip b/chrome/common/extensions/docs/examples/api/infobars/sandwichbar.zip
index 5a5c9f6..7961781 100644
--- a/chrome/common/extensions/docs/examples/api/infobars/sandwichbar.zip
+++ b/chrome/common/extensions/docs/examples/api/infobars/sandwichbar.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/messaging/timer.zip b/chrome/common/extensions/docs/examples/api/messaging/timer.zip
index 8143322..6fbefab 100644
--- a/chrome/common/extensions/docs/examples/api/messaging/timer.zip
+++ b/chrome/common/extensions/docs/examples/api/messaging/timer.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/notifications.zip b/chrome/common/extensions/docs/examples/api/notifications.zip
index 2013295..dc3b72c 100644
--- a/chrome/common/extensions/docs/examples/api/notifications.zip
+++ b/chrome/common/extensions/docs/examples/api/notifications.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/omnibox.zip b/chrome/common/extensions/docs/examples/api/omnibox.zip
index fdebe41..58ba199 100644
--- a/chrome/common/extensions/docs/examples/api/omnibox.zip
+++ b/chrome/common/extensions/docs/examples/api/omnibox.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/override/blank_ntp.zip b/chrome/common/extensions/docs/examples/api/override/blank_ntp.zip
index ea5f6c7..08ccd58 100644
--- a/chrome/common/extensions/docs/examples/api/override/blank_ntp.zip
+++ b/chrome/common/extensions/docs/examples/api/override/blank_ntp.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/override/override_igoogle.zip b/chrome/common/extensions/docs/examples/api/override/override_igoogle.zip
index bdd90fd..daae5dc 100644
--- a/chrome/common/extensions/docs/examples/api/override/override_igoogle.zip
+++ b/chrome/common/extensions/docs/examples/api/override/override_igoogle.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/pageAction/pageaction_by_content.zip b/chrome/common/extensions/docs/examples/api/pageAction/pageaction_by_content.zip
index 714f749..2c172a7 100644
--- a/chrome/common/extensions/docs/examples/api/pageAction/pageaction_by_content.zip
+++ b/chrome/common/extensions/docs/examples/api/pageAction/pageaction_by_content.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/pageAction/pageaction_by_url.zip b/chrome/common/extensions/docs/examples/api/pageAction/pageaction_by_url.zip
index 25365b6..13e3ee3 100644
--- a/chrome/common/extensions/docs/examples/api/pageAction/pageaction_by_url.zip
+++ b/chrome/common/extensions/docs/examples/api/pageAction/pageaction_by_url.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/pageAction/set_icon.zip b/chrome/common/extensions/docs/examples/api/pageAction/set_icon.zip
index 9bd5927..c82a96c 100644
--- a/chrome/common/extensions/docs/examples/api/pageAction/set_icon.zip
+++ b/chrome/common/extensions/docs/examples/api/pageAction/set_icon.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/processes/process_monitor/icon.png b/chrome/common/extensions/docs/examples/api/processes/process_monitor/icon.png
new file mode 100644
index 0000000..9a79a46
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/api/processes/process_monitor/icon.png
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/processes/process_monitor/manifest.json b/chrome/common/extensions/docs/examples/api/processes/process_monitor/manifest.json
new file mode 100644
index 0000000..ae633d3
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/api/processes/process_monitor/manifest.json
@@ -0,0 +1,13 @@
+{
+ "name": "Process Monitor",
+ "version": "1.0",
+ "description": "Adds a browser action that monitors resource usage of all browser processes.",
+ "permissions": [
+ "experimental", "tabs"
+ ],
+ "browser_action": {
+ "default_title": "Process Monitor",
+ "default_icon": "icon.png",
+ "popup": "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
new file mode 100644
index 0000000..61e736b
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/api/processes/process_monitor/popup.html
@@ -0,0 +1,70 @@
+<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>
+<style>
+body {
+ overflow: hidden;
+ margin: 0px;
+ padding: 0px;
+ background: white;
+}
+
+div:first-child {
+ margin-top: 0px;
+}
+
+div, td {
+ padding: 1px 3px;
+ font-family: sans-serif;
+ font-size: 10pt;
+ margin-top: 1px;
+}
+</style>
+</head>
+<body onload="init()">
+<div id="title"><b>Process Monitor</b></div>
+<div id="process-list"><i>Loading...</i></div>
+</body>
+</html>
diff --git a/chrome/common/extensions/docs/examples/api/processes/show_tabs.zip b/chrome/common/extensions/docs/examples/api/processes/show_tabs.zip
index 08659d1..770b435 100644
--- a/chrome/common/extensions/docs/examples/api/processes/show_tabs.zip
+++ b/chrome/common/extensions/docs/examples/api/processes/show_tabs.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/processes/show_tabs/popup.html b/chrome/common/extensions/docs/examples/api/processes/show_tabs/popup.html
index 8f69fc0..5978bfd 100644
--- a/chrome/common/extensions/docs/examples/api/processes/show_tabs/popup.html
+++ b/chrome/common/extensions/docs/examples/api/processes/show_tabs/popup.html
@@ -5,13 +5,13 @@
function init() {
chrome.windows.getCurrent(function(currentWindow) {
chrome.tabs.getSelected(currentWindow.id, function(selectedTab) {
- chrome.experimental.processes.getProcessForTab(selectedTab.id,
- function(process) {
+ chrome.experimental.processes.getProcessIdForTab(selectedTab.id,
+ function(pid) {
var outputDiv = document.getElementById("tab-list");
var titleDiv = document.getElementById("title");
- titleDiv.innerHTML = "<b>Tabs in Process " + process.id + ":</b>";
+ titleDiv.innerHTML = "<b>Tabs in Process " + pid + ":</b>";
displayTabInfo(currentWindow.id, selectedTab, outputDiv);
- displaySameProcessTabs(selectedTab, process.id, outputDiv);
+ displaySameProcessTabs(selectedTab, pid, outputDiv);
}
);
@@ -34,9 +34,9 @@
// Display tab in list if it is in the same process
tabs.forEach(function(tab) {
- chrome.experimental.processes.getProcessForTab(tab.id,
- function(process) {
- if (process.id == processId) {
+ chrome.experimental.processes.getProcessIdForTab(tab.id,
+ function(pid) {
+ if (pid == processId) {
displayTabInfo(tab.windowId, tab, outputDiv);
}
}
diff --git a/chrome/common/extensions/docs/examples/api/tabs/inspector.zip b/chrome/common/extensions/docs/examples/api/tabs/inspector.zip
index 36a74ad..3041820 100644
--- a/chrome/common/extensions/docs/examples/api/tabs/inspector.zip
+++ b/chrome/common/extensions/docs/examples/api/tabs/inspector.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/tabs/screenshot.zip b/chrome/common/extensions/docs/examples/api/tabs/screenshot.zip
index 63c3cb6..2fac0cd 100644
--- a/chrome/common/extensions/docs/examples/api/tabs/screenshot.zip
+++ b/chrome/common/extensions/docs/examples/api/tabs/screenshot.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/api/windows/merge_windows.zip b/chrome/common/extensions/docs/examples/api/windows/merge_windows.zip
index 8614c06..8e39ff7 100644
--- a/chrome/common/extensions/docs/examples/api/windows/merge_windows.zip
+++ b/chrome/common/extensions/docs/examples/api/windows/merge_windows.zip
Binary files differ