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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/extensions/subscribe_page_action/manifest.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 function feedLink(url) { 5 function feedLink(url) {
6 var feed_link = document.createElement('a'); 6 var feed_link = document.createElement('a');
7 feed_link.href = url; 7 feed_link.href = url;
8 feed_link.addEventListener("click", onClick); 8 feed_link.addEventListener("click", onClick);
9 return feed_link; 9 return feed_link;
10 } 10 }
11 11
12 function main() { 12 function main() {
13 chrome.tabs.getSelected(null, function(tab) { 13 chrome.tabs.getSelected(null, function(tab) {
14 var feeds = chrome.extension.getBackgroundPage().feedData[tab.id]; 14 var feeds = JSON.parse(localStorage.getItem(tab.id));
not at google - send to devlin 2013/03/28 00:35:05 I don't fully understand what this is for, but we'
15 if (feeds.length == 1) { 15 if (feeds.length == 1) {
16 // Only one feed, no need for a bubble; go straight to the subscribe page. 16 // Only one feed, no need for a bubble; go straight to the subscribe page.
17 preview(feeds[0].href); 17 preview(feeds[0].href);
18 } else { 18 } else {
19 var content = document.getElementById('content'); 19 var content = document.getElementById('content');
20 var heading = document.getElementById('heading'); 20 var heading = document.getElementById('heading');
21 heading.innerText = 21 heading.innerText =
22 chrome.i18n.getMessage("rss_subscription_action_title"); 22 chrome.i18n.getMessage("rss_subscription_action_title");
23 content.appendChild(document.createElement('br')); 23 content.appendChild(document.createElement('br'));
24 24
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } else { 67 } else {
68 // Show the preview page. 68 // Show the preview page.
69 url = "subscribe.html?" + encodeURIComponent(feed_url); 69 url = "subscribe.html?" + encodeURIComponent(feed_url);
70 } 70 }
71 chrome.tabs.create({ url: url }); 71 chrome.tabs.create({ url: url });
72 window.close(); 72 window.close();
73 } 73 }
74 74
75 // Init on DOM ready. 75 // Init on DOM ready.
76 document.addEventListener('DOMContentLoaded', main); 76 document.addEventListener('DOMContentLoaded', main);
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/subscribe_page_action/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698