зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1100897 - Avoid duplicate RESTORED tab event on startup (r=mhaigh)
This commit is contained in:
Родитель
63f1621378
Коммит
459f23d9b3
|
@ -1514,14 +1514,17 @@ public abstract class GeckoApp
|
|||
// External URLs should always be loaded regardless of whether Gecko is
|
||||
// already running.
|
||||
if (isExternalURL) {
|
||||
// Restore tabs before opening an external URL so that the new tab
|
||||
// is animated properly.
|
||||
Tabs.getInstance().notifyListeners(null, Tabs.TabEvents.RESTORED);
|
||||
loadStartupTab(passedUri);
|
||||
} else if (!mIsRestoringActivity) {
|
||||
loadStartupTab(null);
|
||||
}
|
||||
} else {
|
||||
if (!mIsRestoringActivity) {
|
||||
loadStartupTab(null);
|
||||
}
|
||||
|
||||
// We now have tab stubs from the last session. Any future tabs should
|
||||
// be animated.
|
||||
Tabs.getInstance().notifyListeners(null, Tabs.TabEvents.RESTORED);
|
||||
Tabs.getInstance().notifyListeners(null, Tabs.TabEvents.RESTORED);
|
||||
}
|
||||
|
||||
// If we're not restoring, move the session file so it can be read for
|
||||
// the last tabs section.
|
||||
|
|
|
@ -87,7 +87,6 @@ public class Tabs implements GeckoEventListener {
|
|||
|
||||
private Tabs() {
|
||||
EventDispatcher.getInstance().registerGeckoThreadListener(this,
|
||||
"Session:RestoreEnd",
|
||||
"Tab:Added",
|
||||
"Tab:Close",
|
||||
"Tab:Select",
|
||||
|
@ -410,11 +409,6 @@ public class Tabs implements GeckoEventListener {
|
|||
public void handleMessage(String event, JSONObject message) {
|
||||
Log.d(LOGTAG, "handleMessage: " + event);
|
||||
try {
|
||||
if (event.equals("Session:RestoreEnd")) {
|
||||
notifyListeners(null, TabEvents.RESTORED);
|
||||
return;
|
||||
}
|
||||
|
||||
// All other events handled below should contain a tabID property
|
||||
int id = message.getInt("tabID");
|
||||
Tab tab = getTab(id);
|
||||
|
|
|
@ -142,11 +142,6 @@ SessionStore.prototype = {
|
|||
selected: true
|
||||
});
|
||||
}
|
||||
|
||||
// Let Java know we're done restoring tabs so tabs added after this can be animated
|
||||
Messaging.sendRequest({
|
||||
type: "Session:RestoreEnd"
|
||||
});
|
||||
}.bind(this)
|
||||
};
|
||||
Services.obs.addObserver(restoreCleanup, "sessionstore-windows-restored", false);
|
||||
|
|
Загрузка…
Ссылка в новой задаче