diff options
author | John Reck <jreck@google.com> | 2011-06-29 11:31:24 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2011-06-29 13:28:03 -0700 |
commit | db22ec4ee014900988062d910bc810172a07df56 (patch) | |
tree | 317dd31937a995619e36882d3b2571adf55a7916 /src/com/android/browser/TabControl.java | |
parent | 749b93662b6c3152899d91dbd80139224dc46961 (diff) | |
download | packages_apps_browser-db22ec4ee014900988062d910bc810172a07df56.zip packages_apps_browser-db22ec4ee014900988062d910bc810172a07df56.tar.gz packages_apps_browser-db22ec4ee014900988062d910bc810172a07df56.tar.bz2 |
Fix IntentHandler behavior
Bug: 4473779
Plus, TESTS! Huzzah!
Change-Id: I043e100d99d4653b7fb7885217d7fb305930a137
Diffstat (limited to 'src/com/android/browser/TabControl.java')
-rw-r--r-- | src/com/android/browser/TabControl.java | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java index 1367ba2..2eb24e9 100644 --- a/src/com/android/browser/TabControl.java +++ b/src/com/android/browser/TabControl.java @@ -551,40 +551,28 @@ class TabControl { } } - // This method checks if a non-app tab (one created within the browser) - // matches the given url. + // This method checks if a tab matches the given url. private boolean tabMatchesUrl(Tab t, String url) { - if (t.getAppId() != null) { - return false; - } - WebView webview = t.getWebView(); - if (webview == null) { - return false; - } else if (url.equals(webview.getUrl()) - || url.equals(webview.getOriginalUrl())) { - return true; - } - return false; + return url.equals(t.getUrl()) || url.equals(t.getOriginalUrl()); } /** - * Return the tab that has no app id associated with it and the url of the - * tab matches the given url. + * Return the tab that matches the given url. * @param url The url to search for. */ - Tab findUnusedTabWithUrl(String url) { + Tab findTabWithUrl(String url) { if (url == null) { return null; } // Check the current tab first. - Tab t = getCurrentTab(); - if (t != null && tabMatchesUrl(t, url)) { - return t; + Tab currentTab = getCurrentTab(); + if (currentTab != null && tabMatchesUrl(currentTab, url)) { + return currentTab; } // Now check all the rest. for (Tab tab : mTabs) { if (tabMatchesUrl(tab, url)) { - return t; + return tab; } } return null; |