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

Unified Diff: chrome/common/extensions/docs/examples/api/eventPage/basic/background.js

Issue 10280005: Fix the event page sample extension to say "event page". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: docgen Created 8 years, 8 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/eventPage/basic/background.js
diff --git a/chrome/common/extensions/docs/examples/api/transientPage/basic/background.js b/chrome/common/extensions/docs/examples/api/eventPage/basic/background.js
similarity index 85%
rename from chrome/common/extensions/docs/examples/api/transientPage/basic/background.js
rename to chrome/common/extensions/docs/examples/api/eventPage/basic/background.js
index 48c5e0161145059e5dffcbadd1e3c5a238211602..6d9917b7db845b2a4c708abba82cfddec4fef113 100644
--- a/chrome/common/extensions/docs/examples/api/transientPage/basic/background.js
+++ b/chrome/common/extensions/docs/examples/api/eventPage/basic/background.js
@@ -39,14 +39,16 @@ chrome.bookmarks.onRemoved.addListener(function(id, info) {
});
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
// interact with us.
- chrome.tabs.executeScript({file: "content.js"}, function() {
- // Note: we also sent a message above, upon loading the transient page,
- // but the content script will not be loaded at that point, so we send
- // another here.
- sendMessage();
+ chrome.tabs.create({url: "http://google.com"}, function(tab) {
+ 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
+ // another here.
+ sendMessage();
+ });
});
});
@@ -60,7 +62,7 @@ chrome.extension.onMessage.addListener(function(msg, _, sendResponse) {
} else if (msg.delayedResponse) {
// Note: setTimeout itself does NOT keep the page awake. We return true
// 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() {
sendResponse("Got your message.");
}, 5000);

Powered by Google App Engine
This is Rietveld 408576698