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

Unified Diff: chrome/test/data/extensions/subscribe_page_action/popup.js

Issue 12843037: Convert the RSS extension to event pages to avoid a dedicated background process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 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/test/data/extensions/subscribe_page_action/popup.js
===================================================================
--- chrome/test/data/extensions/subscribe_page_action/popup.js (revision 192298)
+++ chrome/test/data/extensions/subscribe_page_action/popup.js (working copy)
@@ -11,45 +11,48 @@
function main() {
chrome.tabs.getSelected(null, function(tab) {
not at google - send to devlin 2013/04/08 04:39:55 null should be unnecessary now
Finnur 2013/04/08 12:59:24 Done.
- var feeds = chrome.extension.getBackgroundPage().feedData[tab.id];
- if (feeds.length == 1) {
- // Only one feed, no need for a bubble; go straight to the subscribe page.
- preview(feeds[0].href);
- } else {
- var content = document.getElementById('content');
- var heading = document.getElementById('heading');
- heading.innerText =
- chrome.i18n.getMessage("rss_subscription_action_title");
- content.appendChild(document.createElement('br'));
+ chrome.storage.local.get(tab.id.toString(), function(result) {
not at google - send to devlin 2013/04/08 04:39:55 ditto
+ var feeds = result[tab.id];
+ if (feeds.length == 1) {
+ // Only one feed, no need for a bubble; go straight to the subscribe
+ // page.
+ preview(feeds[0].href);
+ } else {
+ var content = document.getElementById('content');
+ var heading = document.getElementById('heading');
+ heading.innerText =
+ chrome.i18n.getMessage("rss_subscription_action_title");
+ content.appendChild(document.createElement('br'));
- var feed_list = document.createElement('table');
- feed_list.style.width = "400";
- for (var i = 0; i < feeds.length; ++i) {
- // Create an RSS image and the anhor encapsulating it.
- var img_link = feedLink(feeds[i].href);
- var img = document.createElement('img');
- img.src = "feed-icon-16x16.png";
- img_link.appendChild(img);
+ var feed_list = document.createElement('table');
+ feed_list.style.width = "400";
+ for (var i = 0; i < feeds.length; ++i) {
+ // Create an RSS image and the anhor encapsulating it.
+ var img_link = feedLink(feeds[i].href);
+ var img = document.createElement('img');
+ img.src = "feed-icon-16x16.png";
+ img_link.appendChild(img);
- // Create a text node and the anchor encapsulating it.
- var text_link = feedLink(feeds[i].href);
- text_link.appendChild(document.createTextNode(feeds[i].title));
+ // Create a text node and the anchor encapsulating it.
+ var text_link = feedLink(feeds[i].href);
+ text_link.appendChild(document.createTextNode(feeds[i].title));
- // Add the data to a row in the table.
- var tr = document.createElement('tr');
- tr.className = "feedList";
- var td = document.createElement('td');
- td.width = "16";
- td.appendChild(img_link);
- var td2 = document.createElement('td');
- td2.appendChild(text_link);
- tr.appendChild(td);
- tr.appendChild(td2);
- feed_list.appendChild(tr);
+ // Add the data to a row in the table.
+ var tr = document.createElement('tr');
+ tr.className = "feedList";
+ var td = document.createElement('td');
+ td.width = "16";
+ td.appendChild(img_link);
+ var td2 = document.createElement('td');
+ td2.appendChild(text_link);
+ tr.appendChild(td);
+ tr.appendChild(td2);
+ feed_list.appendChild(tr);
+ }
+
+ content.appendChild(feed_list);
}
-
- content.appendChild(feed_list);
- }
+ });
});
}

Powered by Google App Engine
This is Rietveld 408576698