Bug 1194182 - Implement switch-to-tab for add-on toast notifications r=margaret

This commit is contained in:
Mark Finkle 2015-10-14 16:08:26 -04:00
Родитель e8aec8d2ac
Коммит 8a4bae3106
1 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -1339,15 +1339,16 @@ var BrowserApp = {
* Otherwise, a new tab is opened with the given URL.
*
* @param aURL URL to open
* @param aFlags Options for the search. Currently supports:
* @param aParam Options used if a tab is created
* @param aFlags Options for the search. Currently supports:
** @option startsWith a Boolean indicating whether to search for a tab who's url starts with the
* requested url. Useful if you want to ignore hash codes on the end of a url. For instance
* to have about:downloads match about:downloads#123.
*/
selectOrOpenTab: function selectOrOpenTab(aURL, aFlags) {
selectOrAddTab: function selectOrAddTab(aURL, aParams, aFlags) {
let tab = this.getTabWithURL(aURL, aFlags);
if (tab == null) {
tab = this.addTab(aURL);
tab = this.addTab(aURL, aParams);
} else {
this.selectTab(tab);
}
@ -5952,7 +5953,7 @@ var XPInstallObserver = {
}).show((data) => {
if (data.button === 0) {
// TODO: Open about:addons to show only unsigned add-ons?
BrowserApp.addTab("about:addons", { parentId: BrowserApp.selectedTab.id });
BrowserApp.selectOrAddTab("about:addons", { parentId: BrowserApp.selectedTab.id });
}
});
},
@ -5980,7 +5981,7 @@ var XPInstallObserver = {
button: {
icon: "drawable://alert_addon",
label: Strings.browser.GetStringFromName("alertAddonsInstalledNoRestart.action2"),
callback: () => { BrowserApp.addTab("about:addons#" + aAddon.id, { parentId: BrowserApp.selectedTab.id }); },
callback: () => { BrowserApp.selectOrAddTab("about:addons", { parentId: BrowserApp.selectedTab.id }); },
}
});
}