summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/Tab.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-06-29 11:31:24 -0700
committerJohn Reck <jreck@google.com>2011-06-29 13:28:03 -0700
commitdb22ec4ee014900988062d910bc810172a07df56 (patch)
tree317dd31937a995619e36882d3b2571adf55a7916 /src/com/android/browser/Tab.java
parent749b93662b6c3152899d91dbd80139224dc46961 (diff)
downloadpackages_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/Tab.java')
-rw-r--r--src/com/android/browser/Tab.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index c78b562..e672e2b 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -152,6 +152,7 @@ class Tab {
// All the state needed for a page
protected static class PageState {
String mUrl;
+ String mOriginalUrl;
String mTitle;
LockIcon mLockIcon;
Bitmap mFavicon;
@@ -159,10 +160,10 @@ class Tab {
PageState(Context c, boolean incognito) {
if (incognito) {
- mUrl = "browser:incognito";
+ mOriginalUrl = mUrl = "browser:incognito";
mTitle = c.getString(R.string.new_incognito_tab);
} else {
- mUrl = "";
+ mOriginalUrl = mUrl = "";
mTitle = c.getString(R.string.new_tab);
}
mFavicon = BitmapFactory.decodeResource(
@@ -171,7 +172,7 @@ class Tab {
}
PageState(Context c, boolean incognito, String url, Bitmap favicon) {
- mUrl = url;
+ mOriginalUrl = mUrl = url;
mTitle = null;
if (URLUtil.isHttpsUrl(url)) {
mLockIcon = LockIcon.LOCK_ICON_SECURE;
@@ -562,6 +563,7 @@ class Tab {
if (mCurrentState.mUrl == null) {
mCurrentState.mUrl = url != null ? url : "";
}
+ mCurrentState.mOriginalUrl = view.getOriginalUrl();
mCurrentState.mTitle = view.getTitle();
mCurrentState.mFavicon = view.getFavicon();
if (!URLUtil.isHttpsUrl(mCurrentState.mUrl)) {
@@ -1677,10 +1679,10 @@ class Tab {
}
String getOriginalUrl() {
- if (mMainView == null) {
- return "";
+ if (mCurrentState.mOriginalUrl == null) {
+ return getUrl();
}
- return UrlUtils.filteredUrl(mMainView.getOriginalUrl());
+ return UrlUtils.filteredUrl(mCurrentState.mOriginalUrl);
}
/**