mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 819070 - Don't restore session if Gecko is already running. r=mfinkle
--HG-- extra : rebase_source : 35f720d9815d6e54d09419002dd30e5ab87f2d1a
This commit is contained in:
parent
6119ce7ac4
commit
54fac48fb7
@ -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
|
||||
|
@ -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));
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user