Backed out changeset 090e52000b34 (bug 1303362) for android failures in test_openWindow.html a=backout

MozReview-Commit-ID: 5Nw8QEy4Z7H
This commit is contained in:
Wes Kocher 2017-01-11 12:53:11 -08:00
parent d11d18336a
commit cee20adcc3
4 changed files with 9 additions and 36 deletions

View File

@ -1547,26 +1547,10 @@ public abstract class GeckoApp
return uri != null && !AboutPages.isAboutHome(uri);
}
protected int getNewTabFlags() {
final boolean isFirstTab = !mWasFirstTabShownAfterActivityUnhidden;
final SafeIntent intent = new SafeIntent(getIntent());
final String action = intent.getAction();
int flags = Tabs.LOADURL_NEW_TAB | Tabs.LOADURL_USER_ENTERED | Tabs.LOADURL_EXTERNAL;
if (ACTION_HOMESCREEN_SHORTCUT.equals(action)) {
flags |= Tabs.LOADURL_PINNED;
}
if (isFirstTab) {
flags |= Tabs.LOADURL_FIRST_AFTER_ACTIVITY_UNHIDDEN;
}
return flags;
}
private void initialize() {
mInitialized = true;
final boolean isFirstTab = !mWasFirstTabShownAfterActivityUnhidden;
mWasFirstTabShownAfterActivityUnhidden = true; // Reset since we'll be loading a tab.
final SafeIntent intent = new SafeIntent(getIntent());
@ -1606,7 +1590,13 @@ public abstract class GeckoApp
processActionViewIntent(new Runnable() {
@Override
public void run() {
final int flags = getNewTabFlags();
int flags = Tabs.LOADURL_NEW_TAB | Tabs.LOADURL_USER_ENTERED | Tabs.LOADURL_EXTERNAL;
if (ACTION_HOMESCREEN_SHORTCUT.equals(action)) {
flags |= Tabs.LOADURL_PINNED;
}
if (isFirstTab) {
flags |= Tabs.LOADURL_FIRST_AFTER_ACTIVITY_UNHIDDEN;
}
loadStartupTab(passedUri, intent, flags);
}
});

View File

@ -71,7 +71,6 @@ public class Tabs implements BundleEventListener, GeckoEventListener {
public static final int LOADURL_EXTERNAL = 1 << 7;
/** Indicates the tab is the first shown after Firefox is hidden and restored. */
public static final int LOADURL_FIRST_AFTER_ACTIVITY_UNHIDDEN = 1 << 8;
public static final int LOADURL_CUSTOMTAB = 1 << 9;
private static final long PERSIST_TABS_AFTER_MILLISECONDS = 1000 * 2;
@ -887,7 +886,6 @@ public class Tabs implements BundleEventListener, GeckoEventListener {
boolean desktopMode = (flags & LOADURL_DESKTOP) != 0;
boolean external = (flags & LOADURL_EXTERNAL) != 0;
final boolean isFirstShownAfterActivityUnhidden = (flags & LOADURL_FIRST_AFTER_ACTIVITY_UNHIDDEN) != 0;
final boolean customTab = (flags & LOADURL_CUSTOMTAB) != 0;
args.put("url", url);
args.put("engine", searchEngine);
@ -896,7 +894,6 @@ public class Tabs implements BundleEventListener, GeckoEventListener {
args.put("isPrivate", isPrivate);
args.put("pinned", (flags & LOADURL_PINNED) != 0);
args.put("desktopMode", desktopMode);
args.put("customTab", customTab);
final boolean needsNewTab;
final String applicationId = (intent == null) ? null :

View File

@ -91,11 +91,6 @@ public class CustomTabsActivity extends GeckoApp implements Tabs.OnTabsChangedLi
Tabs.registerOnTabsChangedListener(this);
}
@Override
protected int getNewTabFlags() {
return Tabs.LOADURL_CUSTOMTAB | super.getNewTabFlags();
}
@Override
public void onDestroy() {
super.onDestroy();

View File

@ -1706,8 +1706,7 @@ var BrowserApp = {
isPrivate: (data.isPrivate === true),
pinned: (data.pinned === true),
delayLoad: (delayLoad === true),
desktopMode: (data.desktopMode === true),
customTab: (data.customTab === true)
desktopMode: (data.desktopMode === true)
};
params.userRequested = url;
@ -3300,13 +3299,6 @@ nsBrowserAccess.prototype = {
aWhere == Ci.nsIBrowserDOMWindow.OPEN_SWITCHTAB);
let isPrivate = false;
let parent = BrowserApp.getTabForWindow(aOpener.top);
if (parent) {
if (parent.isCustomTab) {
newTab = false;
}
}
if (newTab) {
let parentId = -1;
if (!isExternal && aOpener) {
@ -3571,7 +3563,6 @@ Tab.prototype = {
// The search term the user entered to load the current URL
this.userRequested = "userRequested" in aParams ? aParams.userRequested : "";
this.isSearch = "isSearch" in aParams ? aParams.isSearch : false;
this.isCustomTab = "customTab" in aParams ? aParams.customTab : false;
try {
this.browser.loadURIWithFlags(aURL, flags, referrerURI, charset, postData);