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

Unified Diff: chrome/ext/background.js

Issue 29367157: Issue 4680 - Fixed regression with showOptions callback (Closed)
Patch Set: Created Dec. 9, 2016, 10:04 a.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 | « no previous file | lib/notificationHelper.js » ('j') | lib/notificationHelper.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/ext/background.js
diff --git a/chrome/ext/background.js b/chrome/ext/background.js
index 49c0366bfcfe9de61f4b472c0131ea9f3ba614e8..2c146dbc10250dd66504c9f165f9ded25241c09f 100644
--- a/chrome/ext/background.js
+++ b/chrome/ext/background.js
@@ -604,7 +604,32 @@
if ("openOptionsPage" in chrome.runtime)
{
- ext.showOptions = chrome.runtime.openOptionsPage;
+ ext.showOptions = function(callback)
+ {
+ if (!callback)
+ {
+ chrome.runtime.openOptionsPage();
+ }
+ else
+ {
+ chrome.runtime.openOptionsPage(() =>
+ {
+ if (chrome.runtime.lastError)
+ return;
+
+ chrome.tabs.query({active: true, lastFocusedWindow: true}, tabs =>
+ {
+ if (tabs.length > 0)
+ {
+ window.setTimeout(() =>
kzar 2016/12/09 10:08:21 (Necessary for the notification preferences option
+ {
+ callback(new Page(tabs[0]));
+ });
+ }
+ });
+ });
+ }
+ };
}
else
{
« no previous file with comments | « no previous file | lib/notificationHelper.js » ('j') | lib/notificationHelper.js » ('J')

Powered by Google App Engine
This is Rietveld