fix new tab regression
Change-Id: I788343c7df3c282d8f42aeac715ad54eacea77b9
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 0f967ce..4b72ce3 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -56,7 +56,6 @@
import android.provider.ContactsContract;
import android.provider.ContactsContract.Intents.Insert;
import android.speech.RecognizerIntent;
-import android.speech.RecognizerResultsIntent;
import android.text.TextUtils;
import android.util.Log;
import android.util.Patterns;
@@ -1546,7 +1545,7 @@
break;
case R.id.incognito_menu_id:
- openTab(null, true, true, false);
+ openIncognitoTab();
break;
case R.id.goto_menu_id:
@@ -2214,12 +2213,19 @@
}
@Override
+ public Tab openIncognitoTab() {
+ return openTab(INCOGNITO_URI, true, true, false);
+ }
+
+ @Override
public Tab openTab(String url, boolean incognito, boolean setActive,
boolean useCurrent) {
Tab tab = createNewTab(incognito, setActive, useCurrent);
if (tab != null) {
WebView w = tab.getWebView();
- loadUrl(w, ((incognito && url == null) ? INCOGNITO_URI : url));
+ if (url != null) {
+ loadUrl(w, url);
+ }
}
return tab;
}
@@ -2551,7 +2557,7 @@
// exclusive use of a modifier
if (event.isCtrlPressed()) {
if (event.isShiftPressed()) {
- openTab(null, true, true, false);
+ openIncognitoTab();
} else {
openTabToHomePage();
}