Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: background.js

Issue 6622721232338944: Issue 1268 - Correctly mimic Chrome's behavior when opening the options page (Closed)
Patch Set: Created Aug. 26, 2014, 2:43 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « .hgsubstate ('k') | chrome/ext/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: background.js
===================================================================
--- a/background.js
+++ b/background.js
@@ -283,33 +283,6 @@
refreshIconAndContextMenuForAllPages();
});
-/**
- * Opens options page or focuses an existing one, within the last focused window.
- * @param {Function} callback function to be called with the
- Page object of the options page
- */
-function openOptions(callback)
-{
- ext.pages.query({lastFocusedWindow: true}, function(pages)
- {
- var optionsUrl = ext.getURL("options.html");
-
- for (var i = 0; i < pages.length; i++)
- {
- var page = pages[i];
- if (page.url == optionsUrl)
- {
- page.activate();
- if (callback)
- callback(page);
- return;
- }
- }
-
- ext.pages.open(optionsUrl, callback);
- });
-}
-
function prepareNotificationIconAndPopup()
{
var animateIcon = (activeNotification.type !== "question");
@@ -578,7 +551,7 @@
}
break;
case "add-subscription":
- openOptions(function(page)
+ ext.showOptions(function(page)
{
page.sendMessage(msg);
});
« no previous file with comments | « .hgsubstate ('k') | chrome/ext/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld