Commit 7298e58a authored by acleung@chromium.org's avatar acleung@chromium.org

Fix incognito tab restore regression

It seems that the logic from the downstream file is different from the
CL that upstreamed it. This CL restores the downstream logic.

Consider this case:

 type == TabLaunchType.FROM_LONGPRESS_BACKGROUND: FALSE
 type == TabLaunchType.FROM_RESTORE: TRUE
 mTabModelSelector.isIncognitoSelected(): FALSE
 isNewTabIncognito: TRUE

In the downstream version willOpenInForeground -> TRUE
In the current version willOpenInForeground -> FALSE which
incorrectlys restores the incognito tab even thought it isn't
the current tab model.

BUG=383470

Review URL: https://codereview.chromium.org/338833005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277851 0039d316-1c4b-4281-b951-d872f2087c98
parent 61a6fca4
...@@ -131,8 +131,8 @@ public class TabModelOrderController { ...@@ -131,8 +131,8 @@ public class TabModelOrderController {
*/ */
public boolean willOpenInForeground(TabLaunchType type, boolean isNewTabIncognito) { public boolean willOpenInForeground(TabLaunchType type, boolean isNewTabIncognito) {
// Restore is handling the active index by itself. // Restore is handling the active index by itself.
return (type != TabLaunchType.FROM_LONGPRESS_BACKGROUND && if (type == TabLaunchType.FROM_RESTORE) return false;
type != TabLaunchType.FROM_RESTORE) return type != TabLaunchType.FROM_LONGPRESS_BACKGROUND
|| (!mTabModelSelector.isIncognitoSelected() && isNewTabIncognito); || (!mTabModelSelector.isIncognitoSelected() && isNewTabIncognito);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment