зеркало из https://github.com/mozilla/pjs.git
Backout 56ad9ccfcd15 (bug 719494) for native Android M1 crashes
This commit is contained in:
Родитель
61f2f889cc
Коммит
50049562dd
|
@ -914,6 +914,10 @@ abstract public class GeckoApp
|
|||
Boolean selected = message.getBoolean("selected");
|
||||
if (selected)
|
||||
handleSelectTab(tab.getId());
|
||||
} else if (event.equals("Tab:Closed")) {
|
||||
Log.i(LOGTAG, "Destroyed a tab");
|
||||
int tabId = message.getInt("tabID");
|
||||
handleCloseTab(tabId);
|
||||
} else if (event.equals("Tab:ScreenshotData")) {
|
||||
int tabId = message.getInt("tabID");
|
||||
Tab tab = Tabs.getInstance().getTab(tabId);
|
||||
|
@ -1580,6 +1584,7 @@ abstract public class GeckoApp
|
|||
GeckoAppShell.registerGeckoEventListener("Content:LoadError", GeckoApp.mAppContext);
|
||||
GeckoAppShell.registerGeckoEventListener("onCameraCapture", GeckoApp.mAppContext);
|
||||
GeckoAppShell.registerGeckoEventListener("Tab:Added", GeckoApp.mAppContext);
|
||||
GeckoAppShell.registerGeckoEventListener("Tab:Closed", GeckoApp.mAppContext);
|
||||
GeckoAppShell.registerGeckoEventListener("Tab:Selected", GeckoApp.mAppContext);
|
||||
GeckoAppShell.registerGeckoEventListener("Tab:ScreenshotData", GeckoApp.mAppContext);
|
||||
GeckoAppShell.registerGeckoEventListener("Doorhanger:Add", GeckoApp.mAppContext);
|
||||
|
@ -1908,6 +1913,7 @@ abstract public class GeckoApp
|
|||
GeckoAppShell.unregisterGeckoEventListener("Content:LoadError", GeckoApp.mAppContext);
|
||||
GeckoAppShell.unregisterGeckoEventListener("onCameraCapture", GeckoApp.mAppContext);
|
||||
GeckoAppShell.unregisterGeckoEventListener("Tab:Added", GeckoApp.mAppContext);
|
||||
GeckoAppShell.unregisterGeckoEventListener("Tab:Closed", GeckoApp.mAppContext);
|
||||
GeckoAppShell.unregisterGeckoEventListener("Tab:Selected", GeckoApp.mAppContext);
|
||||
GeckoAppShell.unregisterGeckoEventListener("Tab:ScreenshotData", GeckoApp.mAppContext);
|
||||
GeckoAppShell.unregisterGeckoEventListener("Doorhanger:Add", GeckoApp.mAppContext);
|
||||
|
|
|
@ -37,16 +37,15 @@
|
|||
|
||||
package org.mozilla.gecko;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import java.util.*;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.graphics.drawable.*;
|
||||
import android.util.Log;
|
||||
|
||||
import org.json.JSONObject;
|
||||
import org.json.JSONException;
|
||||
|
||||
public class Tabs implements GeckoEventListener {
|
||||
private static final String LOGTAG = "GeckoTabs";
|
||||
|
||||
|
@ -147,8 +146,6 @@ public class Tabs implements GeckoEventListener {
|
|||
|
||||
GeckoAppShell.sendEventToGecko(new GeckoEvent("Tab:Select", String.valueOf(nextTab.getId())));
|
||||
GeckoAppShell.sendEventToGecko(new GeckoEvent("Tab:Close", String.valueOf(tab.getId())));
|
||||
|
||||
GeckoApp.mAppContext.handleCloseTab(tab.getId());
|
||||
}
|
||||
|
||||
/** Return the tab that will be selected by default after this one is closed */
|
||||
|
|
|
@ -469,9 +469,7 @@ var BrowserApp = {
|
|||
return newTab;
|
||||
},
|
||||
|
||||
// WARNING: Calling this will only update the state in BrowserApp. It will
|
||||
// not close the tab in the Java UI.
|
||||
_closeTab: function _closeTab(aTab) {
|
||||
closeTab: function closeTab(aTab) {
|
||||
if (aTab == this.selectedTab)
|
||||
this.selectedTab = null;
|
||||
|
||||
|
@ -849,7 +847,7 @@ var BrowserApp = {
|
|||
} else if (aTopic == "Tab:Select") {
|
||||
this.selectTab(this.getTabForId(parseInt(aData)));
|
||||
} else if (aTopic == "Tab:Close") {
|
||||
this._closeTab(this.getTabForId(parseInt(aData)));
|
||||
this.closeTab(this.getTabForId(parseInt(aData)));
|
||||
} else if (aTopic == "Tab:Screenshot") {
|
||||
this.screenshotTab(aData);
|
||||
} else if (aTopic == "Browser:Quit") {
|
||||
|
@ -1429,6 +1427,14 @@ Tab.prototype = {
|
|||
this.browser = null;
|
||||
this.vbox = null;
|
||||
this.documentIdForCurrentViewport = null;
|
||||
let message = {
|
||||
gecko: {
|
||||
type: "Tab:Closed",
|
||||
tabID: this.id
|
||||
}
|
||||
};
|
||||
|
||||
sendMessageToJava(message);
|
||||
},
|
||||
|
||||
set active(aActive) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче