Skip to content

Commit

Permalink
Merge "DO NOT MERGE Security fix" into gingerbread
Browse files Browse the repository at this point in the history
  • Loading branch information
Maarten Hooft authored and Android (Google) Code Review committed Jun 21, 2011
2 parents 3b8a7db + afa4ab1 commit d0750cb
Showing 1 changed file with 23 additions and 26 deletions.
49 changes: 23 additions & 26 deletions src/com/android/browser/BrowserActivity.java
Expand Up @@ -1785,33 +1785,30 @@ private Tab openTabAndShow(String url, boolean closeOnExit, String appId) {
// url isn't null, it will load the given url.
/* package */Tab openTabAndShow(UrlData urlData, boolean closeOnExit,
String appId) {
final Tab currentTab = mTabControl.getCurrentTab();
if (mTabControl.canCreateNewTab()) {
final Tab tab = mTabControl.createNewTab(closeOnExit, appId,
urlData.mUrl);
WebView webview = tab.getWebView();
// If the last tab was removed from the active tabs page, currentTab
// will be null.
if (currentTab != null) {
removeTabFromContentView(currentTab);
}
// We must set the new tab as the current tab to reflect the old
// animation behavior.
mTabControl.setCurrentTab(tab);
attachTabToContentView(tab);
if (!urlData.isEmpty()) {
loadUrlDataIn(tab, urlData);
}
return tab;
} else {
// Get rid of the subwindow if it exists
dismissSubWindow(currentTab);
if (!urlData.isEmpty()) {
// Load the given url.
loadUrlDataIn(currentTab, urlData);
}
return currentTab;
Tab currentTab = mTabControl.getCurrentTab();
if (!mTabControl.canCreateNewTab()) {
Tab closeTab = mTabControl.getTab(0);
closeTab(closeTab);
if (closeTab == currentTab) {
currentTab = null;
}
}
final Tab tab = mTabControl.createNewTab(closeOnExit, appId,
urlData.mUrl);
WebView webview = tab.getWebView();
// If the last tab was removed from the active tabs page, currentTab
// will be null.
if (currentTab != null) {
removeTabFromContentView(currentTab);
}
// We must set the new tab as the current tab to reflect the old
// animation behavior.
mTabControl.setCurrentTab(tab);
attachTabToContentView(tab);
if (!urlData.isEmpty()) {
loadUrlDataIn(tab, urlData);
}
return tab;
}

private Tab openTab(String url) {
Expand Down

0 comments on commit d0750cb

Please sign in to comment.