Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

packages-apps-Browser: Commit

packages/apps/Browser


Commit MetaInfo

Révisionbd961141b683e856b274cefc69f1c013805e1343 (tree)
l'heure2011-06-22 02:41:23
AuteurJohn Reck <jreck@goog...>
Commiterandroid-merger

Message de Log

DO NOT MERGE Security fix

Bug: 4742007

Change-Id: I187ce151078795ad9b566e9dfbfe69c38d15b478

Change Summary

Modification

--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -1785,33 +1785,30 @@ public class BrowserActivity extends Activity
17851785 // url isn't null, it will load the given url.
17861786 /* package */Tab openTabAndShow(UrlData urlData, boolean closeOnExit,
17871787 String appId) {
1788- final Tab currentTab = mTabControl.getCurrentTab();
1789- if (mTabControl.canCreateNewTab()) {
1790- final Tab tab = mTabControl.createNewTab(closeOnExit, appId,
1791- urlData.mUrl);
1792- WebView webview = tab.getWebView();
1793- // If the last tab was removed from the active tabs page, currentTab
1794- // will be null.
1795- if (currentTab != null) {
1796- removeTabFromContentView(currentTab);
1797- }
1798- // We must set the new tab as the current tab to reflect the old
1799- // animation behavior.
1800- mTabControl.setCurrentTab(tab);
1801- attachTabToContentView(tab);
1802- if (!urlData.isEmpty()) {
1803- loadUrlDataIn(tab, urlData);
1804- }
1805- return tab;
1806- } else {
1807- // Get rid of the subwindow if it exists
1808- dismissSubWindow(currentTab);
1809- if (!urlData.isEmpty()) {
1810- // Load the given url.
1811- loadUrlDataIn(currentTab, urlData);
1812- }
1813- return currentTab;
1788+ Tab currentTab = mTabControl.getCurrentTab();
1789+ if (!mTabControl.canCreateNewTab()) {
1790+ Tab closeTab = mTabControl.getTab(0);
1791+ closeTab(closeTab);
1792+ if (closeTab == currentTab) {
1793+ currentTab = null;
1794+ }
1795+ }
1796+ final Tab tab = mTabControl.createNewTab(closeOnExit, appId,
1797+ urlData.mUrl);
1798+ WebView webview = tab.getWebView();
1799+ // If the last tab was removed from the active tabs page, currentTab
1800+ // will be null.
1801+ if (currentTab != null) {
1802+ removeTabFromContentView(currentTab);
1803+ }
1804+ // We must set the new tab as the current tab to reflect the old
1805+ // animation behavior.
1806+ mTabControl.setCurrentTab(tab);
1807+ attachTabToContentView(tab);
1808+ if (!urlData.isEmpty()) {
1809+ loadUrlDataIn(tab, urlData);
18141810 }
1811+ return tab;
18151812 }
18161813
18171814 private Tab openTab(String url) {
Afficher sur ancien navigateur de dépôt.