diff options
author | Michael Kolb <kolby@google.com> | 2011-03-11 11:30:16 -0800 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2011-03-14 13:35:53 -0700 |
commit | af0d334f54395798d44e300c5f4733af7d477bbe (patch) | |
tree | 8d12924ce974a1e8ffe0b9c45978673bfba3b881 /src | |
parent | 3737aa543fa22c980c72c83f09c5f4e84ed38734 (diff) | |
download | android_packages_apps_Gello-af0d334f54395798d44e300c5f4733af7d477bbe.tar.gz android_packages_apps_Gello-af0d334f54395798d44e300c5f4733af7d477bbe.tar.bz2 android_packages_apps_Gello-af0d334f54395798d44e300c5f4733af7d477bbe.zip |
change app tab behavior
Bug: 3422554
allow apps to open links in new tabs
don't close tabs on back if they were launched from other apps
Change-Id: I3d58354cceca46c15761f70216fa63edb71f0545
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/IntentHandler.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/com/android/browser/IntentHandler.java b/src/com/android/browser/IntentHandler.java index 77db5384..fa8bfbc2 100644 --- a/src/com/android/browser/IntentHandler.java +++ b/src/com/android/browser/IntentHandler.java @@ -145,14 +145,18 @@ public class IntentHandler { || (activateVoiceSearch && appId != null)) && !mActivity.getPackageName().equals(appId) && (flags & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) { - Tab appTab = mTabControl.getTabFromId(appId); - if (appTab != null) { - mController.reuseTab(appTab, appId, urlData); - return; + if (activateVoiceSearch) { + Tab appTab = mTabControl.getTabFromId(appId); + if (appTab != null) { + mController.reuseTab(appTab, appId, urlData); + return; + } else { + mController.openTabAndShow(null, urlData, false, appId); + } } else { // No matching application tab, try to find a regular tab // with a matching url. - appTab = mTabControl.findUnusedTabWithUrl(urlData.mUrl); + Tab appTab = mTabControl.findUnusedTabWithUrl(urlData.mUrl); if (appTab != null) { if (current != appTab) { mController.switchToTab(mTabControl.getTabIndex(appTab)); @@ -164,7 +168,7 @@ public class IntentHandler { // MAX_TABS. Then the url will be opened in the current // tab. If a new tab is created, it will have "true" for // exit on close. - mController.openTabAndShow(null, urlData, true, appId); + mController.openTabAndShow(null, urlData, false, appId); } } } else { |