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

Side by Side Diff: chrome/test/data/extensions/samples/subscribe_page_action/background.html

Issue 179027: Make a bunch of backlogged breaking changes to the extensions (Closed)
Patch Set: Put chrome.self back Created 11 years, 3 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 unified diff | Download patch
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script> 3 <script>
4 // The Page Action ID. 4 // The Page Action ID.
5 var pageActionId = "RssPageAction"; 5 var pageActionId = "RssPageAction";
6 6
7 // The icon to use. This corresponds to the icon listed in the manifest. 7 // The icon to use. This corresponds to the icon listed in the manifest.
8 var subscribeId = 0; 8 var subscribeId = 0;
9 9
10 // A dictionary keyed off of tabId that keeps track of data per tab (for 10 // A dictionary keyed off of tabId that keeps track of data per tab (for
11 // example what feedUrl was detected in the tab). 11 // example what feedUrl was detected in the tab).
12 var feedData = {}; 12 var feedData = {};
13 13
14 chrome.self.onConnect.addListener(function(port) { 14 chrome.extension.onConnect.addListener(function(port) {
15 // This will get called from the content script using PostMessage. 15 // This will get called from the content script using PostMessage.
16 // |feedUrls| is a list of URL feeds found on the page. We only need 1 to 16 // |feedUrls| is a list of URL feeds found on the page. We only need 1 to
17 // enable the PageAction icon in the Omnibox. 17 // enable the PageAction icon in the Omnibox.
18 port.onMessage.addListener(function(feedUrls) { 18 port.onMessage.addListener(function(feedUrls) {
19 feedUrl = feedUrls[0]; 19 feedUrl = feedUrls[0];
20 // Let Chrome know that the PageAction needs to be enabled for this tabId 20 // Let Chrome know that the PageAction needs to be enabled for this tabId
21 // and for the url of this page. 21 // and for the url of this page.
22 if (feedUrl) { 22 if (feedUrl) {
23 feedData[port.tab.id] = {pageUrl: port.tab.url, 23 feedData[port.tab.id] = {pageUrl: port.tab.url,
24 feedUrl: feedUrl}; 24 feedUrl: feedUrl};
(...skipping 25 matching lines...) Expand all
50 }); 50 });
51 }); 51 });
52 }); 52 });
53 53
54 chrome.tabs.onRemoved.addListener(function(reply) { 54 chrome.tabs.onRemoved.addListener(function(reply) {
55 feedData[reply.tabId] = null; 55 feedData[reply.tabId] = null;
56 }); 56 });
57 </script> 57 </script>
58 </head> 58 </head>
59 </html> 59 </html>
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/samples/subscribe/toolstrip.html ('k') | chrome/test/data/extensions/uitest/event_sink/test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698