diff options
author | Iain Merrick <husky@google.com> | 2010-11-01 12:19:54 +0000 |
---|---|---|
committer | Iain Merrick <husky@google.com> | 2010-11-03 10:21:10 +0000 |
commit | 731df977c0511bca2206b5f333555b1205ff1f43 (patch) | |
tree | 0e750b949b3f00a1ac11fda25d3c2de512f2b465 /chrome/common/extensions/docs/examples/api | |
parent | 5add15e10e7bb80512f2c597ca57221314abe577 (diff) | |
download | external_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')
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 Binary files differindex 7460329..fddc7df 100644 --- a/chrome/common/extensions/docs/examples/api/bookmarks/basic.zip +++ b/chrome/common/extensions/docs/examples/api/bookmarks/basic.zip 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 Binary files differindex 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 diff --git a/chrome/common/extensions/docs/examples/api/browserAction/print.zip b/chrome/common/extensions/docs/examples/api/browserAction/print.zip Binary files differindex 95c9329..bf50d51 100644 --- a/chrome/common/extensions/docs/examples/api/browserAction/print.zip +++ b/chrome/common/extensions/docs/examples/api/browserAction/print.zip 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 Binary files differindex 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 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 Binary files differindex 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 diff --git a/chrome/common/extensions/docs/examples/api/contextMenus/basic.zip b/chrome/common/extensions/docs/examples/api/contextMenus/basic.zip Binary files differindex 443d83b..3e505f9 100644 --- a/chrome/common/extensions/docs/examples/api/contextMenus/basic.zip +++ b/chrome/common/extensions/docs/examples/api/contextMenus/basic.zip diff --git a/chrome/common/extensions/docs/examples/api/cookies.zip b/chrome/common/extensions/docs/examples/api/cookies.zip Binary files differindex edd8163..a02c566 100644 --- a/chrome/common/extensions/docs/examples/api/cookies.zip +++ b/chrome/common/extensions/docs/examples/api/cookies.zip diff --git a/chrome/common/extensions/docs/examples/api/history/showHistory.zip b/chrome/common/extensions/docs/examples/api/history/showHistory.zip Binary files differindex 970cf68..f347d0c 100644 --- a/chrome/common/extensions/docs/examples/api/history/showHistory.zip +++ b/chrome/common/extensions/docs/examples/api/history/showHistory.zip diff --git a/chrome/common/extensions/docs/examples/api/i18n/cld.zip b/chrome/common/extensions/docs/examples/api/i18n/cld.zip Binary files differindex f809b4b..5cf6424 100644 --- a/chrome/common/extensions/docs/examples/api/i18n/cld.zip +++ b/chrome/common/extensions/docs/examples/api/i18n/cld.zip diff --git a/chrome/common/extensions/docs/examples/api/i18n/getMessage.zip b/chrome/common/extensions/docs/examples/api/i18n/getMessage.zip Binary files differindex a67a0ae..9dab5b0 100644 --- a/chrome/common/extensions/docs/examples/api/i18n/getMessage.zip +++ b/chrome/common/extensions/docs/examples/api/i18n/getMessage.zip diff --git a/chrome/common/extensions/docs/examples/api/idle/idle_simple.zip b/chrome/common/extensions/docs/examples/api/idle/idle_simple.zip Binary files differindex 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 diff --git a/chrome/common/extensions/docs/examples/api/infobars/sandwichbar.zip b/chrome/common/extensions/docs/examples/api/infobars/sandwichbar.zip Binary files differindex 5a5c9f6..7961781 100644 --- a/chrome/common/extensions/docs/examples/api/infobars/sandwichbar.zip +++ b/chrome/common/extensions/docs/examples/api/infobars/sandwichbar.zip diff --git a/chrome/common/extensions/docs/examples/api/messaging/timer.zip b/chrome/common/extensions/docs/examples/api/messaging/timer.zip Binary files differindex 8143322..6fbefab 100644 --- a/chrome/common/extensions/docs/examples/api/messaging/timer.zip +++ b/chrome/common/extensions/docs/examples/api/messaging/timer.zip diff --git a/chrome/common/extensions/docs/examples/api/notifications.zip b/chrome/common/extensions/docs/examples/api/notifications.zip Binary files differindex 2013295..dc3b72c 100644 --- a/chrome/common/extensions/docs/examples/api/notifications.zip +++ b/chrome/common/extensions/docs/examples/api/notifications.zip diff --git a/chrome/common/extensions/docs/examples/api/omnibox.zip b/chrome/common/extensions/docs/examples/api/omnibox.zip Binary files differindex fdebe41..58ba199 100644 --- a/chrome/common/extensions/docs/examples/api/omnibox.zip +++ b/chrome/common/extensions/docs/examples/api/omnibox.zip diff --git a/chrome/common/extensions/docs/examples/api/override/blank_ntp.zip b/chrome/common/extensions/docs/examples/api/override/blank_ntp.zip Binary files differindex 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 diff --git a/chrome/common/extensions/docs/examples/api/override/override_igoogle.zip b/chrome/common/extensions/docs/examples/api/override/override_igoogle.zip Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 diff --git a/chrome/common/extensions/docs/examples/api/pageAction/set_icon.zip b/chrome/common/extensions/docs/examples/api/pageAction/set_icon.zip Binary files differindex 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 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 Binary files differnew file mode 100644 index 0000000..9a79a46 --- /dev/null +++ b/chrome/common/extensions/docs/examples/api/processes/process_monitor/icon.png 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 Binary files differindex 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 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 Binary files differindex 36a74ad..3041820 100644 --- a/chrome/common/extensions/docs/examples/api/tabs/inspector.zip +++ b/chrome/common/extensions/docs/examples/api/tabs/inspector.zip diff --git a/chrome/common/extensions/docs/examples/api/tabs/screenshot.zip b/chrome/common/extensions/docs/examples/api/tabs/screenshot.zip Binary files differindex 63c3cb6..2fac0cd 100644 --- a/chrome/common/extensions/docs/examples/api/tabs/screenshot.zip +++ b/chrome/common/extensions/docs/examples/api/tabs/screenshot.zip diff --git a/chrome/common/extensions/docs/examples/api/windows/merge_windows.zip b/chrome/common/extensions/docs/examples/api/windows/merge_windows.zip Binary files differindex 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 |