Fix the event page sample extension to say "event page".

BUG=no
TEST=no

Review URL: https://chromiumcodereview.appspot.com/10280005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134815 0039d316-1c4b-4281-b951-d872f2087c98
parent 67f59814
...@@ -39,15 +39,17 @@ chrome.bookmarks.onRemoved.addListener(function(id, info) { ...@@ -39,15 +39,17 @@ chrome.bookmarks.onRemoved.addListener(function(id, info) {
}); });
chrome.browserAction.onClicked.addListener(function() { chrome.browserAction.onClicked.addListener(function() {
// The transient page will unload after handling this event (assuming nothing // The event page will unload after handling this event (assuming nothing
// else is keeping it awake). The content script will become the main way to // else is keeping it awake). The content script will become the main way to
// interact with us. // interact with us.
chrome.tabs.executeScript({file: "content.js"}, function() { chrome.tabs.create({url: "http://google.com"}, function(tab) {
// Note: we also sent a message above, upon loading the transient page, chrome.tabs.executeScript(tab.id, {file: "content.js"}, function() {
// Note: we also sent a message above, upon loading the event page,
// but the content script will not be loaded at that point, so we send // but the content script will not be loaded at that point, so we send
// another here. // another here.
sendMessage(); sendMessage();
}); });
});
}); });
chrome.experimental.keybinding.onCommand.addListener(function(command) { chrome.experimental.keybinding.onCommand.addListener(function(command) {
...@@ -60,7 +62,7 @@ chrome.extension.onMessage.addListener(function(msg, _, sendResponse) { ...@@ -60,7 +62,7 @@ chrome.extension.onMessage.addListener(function(msg, _, sendResponse) {
} else if (msg.delayedResponse) { } else if (msg.delayedResponse) {
// Note: setTimeout itself does NOT keep the page awake. We return true // Note: setTimeout itself does NOT keep the page awake. We return true
// from the onMessage event handler, which keeps the message channel open - // from the onMessage event handler, which keeps the message channel open -
// in turn keeping the transient page awake - until we call sendResponse. // in turn keeping the event page awake - until we call sendResponse.
setTimeout(function() { setTimeout(function() {
sendResponse("Got your message."); sendResponse("Got your message.");
}, 5000); }, 5000);
......
{ {
"name": "Transient Page Example", "name": "Event Page Example",
"description": "Demonstrates usage and features of the transient page", "description": "Demonstrates usage and features of the event page",
"version": "1.0", "version": "1.0",
"manifest_version": 2, "manifest_version": 2,
"permissions": ["tabs", "bookmarks", "experimental", "keybinding", "http://*.google.com/*"], "permissions": ["tabs", "bookmarks", "experimental", "keybinding", "http://*.google.com/*"],
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
}, },
"browser_action": { "browser_action": {
"default_icon" : "icon.png", "default_icon" : "icon.png",
"default_title": "Start Transient Page" "default_title": "Start Event Page"
}, },
"commands": { "commands": {
"open-google": { "open-google": {
......
This diff is collapsed.
...@@ -177,6 +177,12 @@ ...@@ -177,6 +177,12 @@
"chrome.experimental.speechInput.onSoundStart": "experimental.speechInput.html#event-onSoundStart", "chrome.experimental.speechInput.onSoundStart": "experimental.speechInput.html#event-onSoundStart",
"chrome.experimental.speechInput.start": "experimental.speechInput.html#method-start", "chrome.experimental.speechInput.start": "experimental.speechInput.html#method-start",
"chrome.experimental.speechInput.stop": "experimental.speechInput.html#method-stop", "chrome.experimental.speechInput.stop": "experimental.speechInput.html#method-stop",
"chrome.experimental.usb.bulkTransfer": "experimental.usb.html#method-bulkTransfer",
"chrome.experimental.usb.closeDevice": "experimental.usb.html#method-closeDevice",
"chrome.experimental.usb.controlTransfer": "experimental.usb.html#method-controlTransfer",
"chrome.experimental.usb.findDevice": "experimental.usb.html#method-findDevice",
"chrome.experimental.usb.interruptTransfer": "experimental.usb.html#method-interruptTransfer",
"chrome.experimental.usb.onEvent": "experimental.usb.html#event-onEvent",
"chrome.experimental.webRequest.onRequest": "experimental.webRequest.html#event-onRequest", "chrome.experimental.webRequest.onRequest": "experimental.webRequest.html#event-onRequest",
"chrome.extension.connect": "extension.html#method-connect", "chrome.extension.connect": "extension.html#method-connect",
"chrome.extension.getBackgroundPage": "extension.html#method-getBackgroundPage", "chrome.extension.getBackgroundPage": "extension.html#method-getBackgroundPage",
...@@ -1035,6 +1041,51 @@ ...@@ -1035,6 +1041,51 @@
"source_hash": "270fca47d275f5713835f280b4ef665e700d8b03", "source_hash": "270fca47d275f5713835f280b4ef665e700d8b03",
"zip_path": "examples/extensions/email_this_page.zip" "zip_path": "examples/extensions/email_this_page.zip"
}, },
{
"api_calls": [
"chrome.bookmarks.onRemoved",
"chrome.browserAction.onClicked",
"chrome.browserAction.setBadgeText",
"chrome.experimental.alarms.create",
"chrome.experimental.alarms.onAlarm",
"chrome.experimental.keybinding.onCommand",
"chrome.experimental.runtime.onBackgroundPageUnloadingSoon",
"chrome.experimental.runtime.onInstalled",
"chrome.experimental.webRequest.onRequest",
"chrome.extension.onMessage",
"chrome.extension.sendMessage",
"chrome.tabs.create",
"chrome.tabs.executeScript",
"chrome.tabs.query",
"chrome.tabs.sendMessage"
],
"crx_path": null,
"description": "Demonstrates usage and features of the event page",
"features": [
"background_page",
"bookmarks",
"browser_action",
"experimental",
"keybinding",
"tabs"
],
"icon": null,
"id": "26115f23aef245d6757587e3e517bbe4b3bc55fe",
"name": "Event Page Example",
"packaged_app": false,
"path": "examples/api/eventPage/basic/",
"protocols": [
"http://"
],
"search_string": "EVENT PAGE EXAMPLE DEMONSTRATES USAGE AND FEATURES OF THE EVENT PAGE BACKGROUND_PAGE BOOKMARKS BROWSER_ACTION EXPERIMENTAL KEYBINDING TABS CHROME.BOOKMARKS.ONREMOVED CHROME.BROWSERACTION.ONCLICKED CHROME.BROWSERACTION.SETBADGETEXT CHROME.EXPERIMENTAL.ALARMS.CREATE CHROME.EXPERIMENTAL.ALARMS.ONALARM CHROME.EXPERIMENTAL.KEYBINDING.ONCOMMAND CHROME.EXPERIMENTAL.RUNTIME.ONBACKGROUNDPAGEUNLOADINGSOON CHROME.EXPERIMENTAL.RUNTIME.ONINSTALLED CHROME.EXPERIMENTAL.WEBREQUEST.ONREQUEST CHROME.EXTENSION.ONMESSAGE CHROME.EXTENSION.SENDMESSAGE CHROME.TABS.CREATE CHROME.TABS.EXECUTESCRIPT CHROME.TABS.QUERY CHROME.TABS.SENDMESSAGE",
"source_files": [
"background.js",
"content.js",
"manifest.json"
],
"source_hash": "da33fa65c04b727c11cfab8c46e548f34808aaed",
"zip_path": "examples/api/eventPage/basic.zip"
},
{ {
"api_calls": [], "api_calls": [],
"crx_path": null, "crx_path": null,
...@@ -2482,51 +2533,6 @@ ...@@ -2482,51 +2533,6 @@
"source_hash": "683f9b121326abe7053ea011b27dbd03f5b7b9d7", "source_hash": "683f9b121326abe7053ea011b27dbd03f5b7b9d7",
"zip_path": "examples/api/permissions/extension-questions.zip" "zip_path": "examples/api/permissions/extension-questions.zip"
}, },
{
"api_calls": [
"chrome.bookmarks.onRemoved",
"chrome.browserAction.onClicked",
"chrome.browserAction.setBadgeText",
"chrome.experimental.alarms.create",
"chrome.experimental.alarms.onAlarm",
"chrome.experimental.keybinding.onCommand",
"chrome.experimental.runtime.onBackgroundPageUnloadingSoon",
"chrome.experimental.runtime.onInstalled",
"chrome.experimental.webRequest.onRequest",
"chrome.extension.onMessage",
"chrome.extension.sendMessage",
"chrome.tabs.create",
"chrome.tabs.executeScript",
"chrome.tabs.query",
"chrome.tabs.sendMessage"
],
"crx_path": null,
"description": "Demonstrates usage and features of the transient page",
"features": [
"background_page",
"bookmarks",
"browser_action",
"experimental",
"keybinding",
"tabs"
],
"icon": null,
"id": "7db846942d754cb51d0fd1fcb60a97fa4f1e21ad",
"name": "Transient Page Example",
"packaged_app": false,
"path": "examples/api/transientPage/basic/",
"protocols": [
"http://"
],
"search_string": "TRANSIENT PAGE EXAMPLE DEMONSTRATES USAGE AND FEATURES OF THE TRANSIENT PAGE BACKGROUND_PAGE BOOKMARKS BROWSER_ACTION EXPERIMENTAL KEYBINDING TABS CHROME.BOOKMARKS.ONREMOVED CHROME.BROWSERACTION.ONCLICKED CHROME.BROWSERACTION.SETBADGETEXT CHROME.EXPERIMENTAL.ALARMS.CREATE CHROME.EXPERIMENTAL.ALARMS.ONALARM CHROME.EXPERIMENTAL.KEYBINDING.ONCOMMAND CHROME.EXPERIMENTAL.RUNTIME.ONBACKGROUNDPAGEUNLOADINGSOON CHROME.EXPERIMENTAL.RUNTIME.ONINSTALLED CHROME.EXPERIMENTAL.WEBREQUEST.ONREQUEST CHROME.EXTENSION.ONMESSAGE CHROME.EXTENSION.SENDMESSAGE CHROME.TABS.CREATE CHROME.TABS.EXECUTESCRIPT CHROME.TABS.QUERY CHROME.TABS.SENDMESSAGE",
"source_files": [
"background.js",
"content.js",
"manifest.json"
],
"source_hash": "6d52786858ac8c46aad6fe09754d1f44a6fc888a",
"zip_path": "examples/api/transientPage/basic.zip"
},
{ {
"api_calls": [ "api_calls": [
"chrome.tts.getVoices", "chrome.tts.getVoices",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment