[Pkg-mozext-commits] [tabmixplus] 22/44: Show background tab group restoration page
David Prévot
taffit at moszumanska.debian.org
Fri Mar 18 20:57:15 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository tabmixplus.
commit 7d8d0c1493774b4d4ac73c30d71f8a1a6202faa9
Author: onemen <tabmix.onemen at gmail.com>
Date: Sun Feb 28 20:30:06 2016 +0200
Show background tab group restoration page
---
chrome/content/session/session.js | 4 ++++
modules/TabGroupsMigrator.jsm | 10 ++++++++++
2 files changed, 14 insertions(+)
diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index d0c937d..3b12961 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -3085,6 +3085,10 @@ TabmixSessionManager = {
// strips out the hidden tab groups and all tabview metadata
let hiddenTabState = this.TabmixGroupsMigrator.removeHiddenTabGroupsFromState(state);
tabsRemoved = hiddenTabState.windows.length > 0;
+ if (caller == "firstwindowopen" && hiddenTabState &&
+ this.showTabGroupRestorationPage) {
+ this.TabmixGroupsMigrator.showBackgroundTabGroupRestorationPage(state, hiddenTabState);
+ }
}
if (concatenate) {
// move all tabs & closed tabs into one window
diff --git a/modules/TabGroupsMigrator.jsm b/modules/TabGroupsMigrator.jsm
index 4e91d8c..11ac8bc 100644
--- a/modules/TabGroupsMigrator.jsm
+++ b/modules/TabGroupsMigrator.jsm
@@ -77,6 +77,7 @@ this.TabmixGroupsMigrator = {
let state = window.TabmixConvertSession.getSessionState(session, true);
let groupData = this.gatherGroupData(state);
if (groupData.exist) {
+ sm.showTabGroupRestorationPage = true;
this.bookmarkAllGroupsFromState(groupData.data);
}
};
@@ -274,4 +275,13 @@ this.TabmixGroupsMigrator = {
);
return sessionsFolder;
},
+
+ showBackgroundTabGroupRestorationPage: function(state, backgroundData) {
+ const RECOVERY_URL = "chrome://browser/content/aboutTabGroupsMigration.xhtml";
+ let win = state.windows[state.windows.length - 1];
+ let formdata = {id: {sessionData: JSON.stringify(backgroundData)}, url: RECOVERY_URL};
+ let newTab = {entries: [{url: RECOVERY_URL}], formdata: formdata, index: 1};
+ // Add tab and mark it as selected:
+ win.selected = win.tabs.push(newTab);
+ },
};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git
More information about the Pkg-mozext-commits
mailing list