Skip to content

Commit

Permalink
Bug 726560 - v2: trying to get saved tab group title without delaying…
Browse files Browse the repository at this point in the history
… startup
  • Loading branch information
xabolcs committed Mar 13, 2012
1 parent 57e2da6 commit 7dbf770
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
27 changes: 20 additions & 7 deletions extension/chrome/content/browser.js
Expand Up @@ -105,14 +105,27 @@ init: function()

// grab the last used group title
// use TabView's property if we are before Bug 682996 (landed in FF10)
nightlyApp._lastSessionGroupName = (TabView && TabView._lastSessionGroupName)
? TabView._lastSessionGroupName
: Cc["@mozilla.org/browser/sessionstore;1"]
.getService(Ci.nsISessionStore)
.getWindowValue(
window,
nightlyApp.LAST_SESSION_GROUP_NAME_IDENTIFIER
if (TabView && TabView._lastSessionGroupName)
{
nightlyApp._lastSessionGroupName = TabView._lastSessionGroupName;
}
else
{
Cc["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService).addObserver({
observe: function NightlyTT_Restore() {
Cc["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService).removeObserver(this, "sessionstore-windows-restored");

nightlyApp._lastSessionGroupName = Cc["@mozilla.org/browser/sessionstore;1"]
.getService(Ci.nsISessionStore)
.getWindowValue(
window,
nightlyApp.LAST_SESSION_GROUP_NAME_IDENTIFIER
);
}
}, "sessionstore-windows-restored", false);
}
},

openURL: function(url)
Expand Down
4 changes: 0 additions & 4 deletions extension/chrome/content/nightly.js
Expand Up @@ -108,10 +108,6 @@ showAlert: function(id, args) {

init: function() {
window.removeEventListener("load", nightly.init, false);
setTimeout(nightly.initLazy,800);
},

initLazy: function() {
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
nightly.preferences = prefs.getBranch("nightly.")
Expand Down

0 comments on commit 7dbf770

Please sign in to comment.