diff options
author | Michael Kolb <kolby@google.com> | 2012-04-17 14:10:52 -0700 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2012-04-17 14:55:40 -0700 |
commit | f1286a455eeacd02dfcca1335e6a7a9f87433c1b (patch) | |
tree | c141d2def88f04657de5bf74c35983dfb54c26ea /src | |
parent | 0ce8ea567a3ef07d7f691cb2a2716024b5192e01 (diff) | |
download | packages_apps_browser-f1286a455eeacd02dfcca1335e6a7a9f87433c1b.zip packages_apps_browser-f1286a455eeacd02dfcca1335e6a7a9f87433c1b.tar.gz packages_apps_browser-f1286a455eeacd02dfcca1335e6a7a9f87433c1b.tar.bz2 |
Re-use tab for an intent created by browser
Bug: 6332680
Change-Id: If9c754e2320e8f112a816c54138918fbaf360597
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/IntentHandler.java | 10 | ||||
-rw-r--r-- | src/com/android/browser/UrlHandler.java | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/com/android/browser/IntentHandler.java b/src/com/android/browser/IntentHandler.java index ecd4545..b21c688 100644 --- a/src/com/android/browser/IntentHandler.java +++ b/src/com/android/browser/IntentHandler.java @@ -157,6 +157,16 @@ public class IntentHandler { mController.openTab(urlData); return; } + if (Intent.ACTION_VIEW.equals(action) + && (appId != null) + && appId.startsWith(mActivity.getPackageName())) { + Tab appTab = mTabControl.getTabFromAppId(appId); + if ((appTab != null) && (appTab == mController.getCurrentTab())) { + mController.switchToTab(appTab); + mController.loadUrlDataIn(appTab, urlData); + return; + } + } if ((Intent.ACTION_VIEW.equals(action) // If a voice search has no appId, it means that it came // from the browser. In that case, reuse the current tab. diff --git a/src/com/android/browser/UrlHandler.java b/src/com/android/browser/UrlHandler.java index a4df999..ac4b880 100644 --- a/src/com/android/browser/UrlHandler.java +++ b/src/com/android/browser/UrlHandler.java @@ -163,7 +163,7 @@ public class UrlHandler { // Re-use the existing tab if the intent comes back to us if (tab != null) { if (tab.getAppId() == null) { - tab.setAppId("com.android.browser-" + tab.getId()); + tab.setAppId(mActivity.getPackageName() + "-" + tab.getId()); } intent.putExtra(Browser.EXTRA_APPLICATION_ID, tab.getAppId()); } |