Bug 819070 - Don't restore session if Gecko is already running. r=mfinkle

--HG--
extra : rebase_source : 35f720d9815d6e54d09419002dd30e5ab87f2d1a
This commit is contained in:
Brian Nicholson 2012-12-07 10:50:56 -08:00
parent 6119ce7ac4
commit 54fac48fb7
4 changed files with 21 additions and 18 deletions

View File

@ -260,7 +260,7 @@ abstract public class BrowserApp extends GeckoApp
}
@Override
protected void initializeChrome(String uri, Boolean isExternalURL) {
protected void initializeChrome(String uri, boolean isExternalURL) {
super.initializeChrome(uri, isExternalURL);
mBrowserToolbar.updateBackButton(false);
@ -268,19 +268,23 @@ abstract public class BrowserApp extends GeckoApp
mDoorHangerPopup.setAnchor(mBrowserToolbar.mFavicon);
if (!isExternalURL) {
// show about:home if we aren't restoring previous session
if (mRestoreMode == RESTORE_NONE) {
Tab tab = Tabs.getInstance().loadUrl("about:home", Tabs.LOADURL_NEW_TAB);
} else {
hideAboutHome();
mAboutHomeStartupTimer.cancel();
}
} else {
int flags = Tabs.LOADURL_NEW_TAB | Tabs.LOADURL_USER_ENTERED;
Tabs.getInstance().loadUrl(uri, flags);
if (isExternalURL || mRestoreMode != RESTORE_NONE) {
mAboutHomeStartupTimer.cancel();
}
if (!mIsRestoringActivity) {
if (!isExternalURL) {
// show about:home if we aren't restoring previous session
if (mRestoreMode == RESTORE_NONE) {
Tab tab = Tabs.getInstance().loadUrl("about:home", Tabs.LOADURL_NEW_TAB);
} else {
hideAboutHome();
}
} else {
int flags = Tabs.LOADURL_NEW_TAB | Tabs.LOADURL_USER_ENTERED;
Tabs.getInstance().loadUrl(uri, flags);
}
}
}
@Override

View File

@ -163,7 +163,7 @@ abstract public class GeckoApp
public Handler mMainHandler;
private GeckoProfile mProfile;
public static int mOrientation;
private boolean mIsRestoringActivity;
protected boolean mIsRestoringActivity;
private String mCurrentResponse = "";
public static boolean sIsUsingCustomProfile = false;
@ -1480,7 +1480,7 @@ abstract public class GeckoApp
});
}
protected void initializeChrome(String uri, Boolean isExternalURL) {
protected void initializeChrome(String uri, boolean isExternalURL) {
mDoorHangerPopup = new DoorHangerPopup(this, null);
mPluginContainer = (AbsoluteLayout) findViewById(R.id.plugin_container);
mFormAssistPopup = (FormAssistPopup) findViewById(R.id.form_assist_popup);
@ -1581,7 +1581,7 @@ abstract public class GeckoApp
// If we are doing a restore, read the session data and send it to Gecko
String restoreMessage = null;
if (mRestoreMode != RESTORE_NONE) {
if (mRestoreMode != RESTORE_NONE && !mIsRestoringActivity) {
try {
String sessionString = getProfile().readSessionFile(false);
if (sessionString == null) {
@ -1774,7 +1774,7 @@ abstract public class GeckoApp
setLaunchState(GeckoApp.LaunchState.GeckoRunning);
Tab selectedTab = Tabs.getInstance().getSelectedTab();
if (selectedTab != null)
Tabs.getInstance().selectTab(selectedTab.getId());
Tabs.getInstance().notifyListeners(selectedTab, Tabs.TabEvents.SELECTED);
connectGeckoLayerClient();
GeckoAppShell.setLayerClient(mLayerView.getLayerClient());
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Viewport:Flush", null));

View File

@ -113,7 +113,6 @@ public class Tabs implements GeckoEventListener {
public void run() {
mActivity.hideFormAssistPopup();
if (isSelectedTab(tab)) {
String url = tab.getURL();
notifyListeners(tab, TabEvents.SELECTED);
if (oldTab != null)

View File

@ -89,7 +89,7 @@ public class WebApp extends GeckoApp {
}
@Override
protected void initializeChrome(String uri, Boolean isExternalURL) {
protected void initializeChrome(String uri, boolean isExternalURL) {
super.initializeChrome(uri, isExternalURL);
Tabs.getInstance().loadUrl(uri, Tabs.LOADURL_NEW_TAB | Tabs.LOADURL_USER_ENTERED | Tabs.LOADURL_PINNED);
}