OSDN Git Service

Merge "DO NOT MERGE Fix vanishing title/url in window picker" into gingerbread
authorJohn Reck <jreck@google.com>
Fri, 27 May 2011 20:43:23 +0000 (13:43 -0700)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Fri, 27 May 2011 20:43:23 +0000 (13:43 -0700)
src/com/android/browser/Tab.java

index af0cdf8..6eaf4b1 100644 (file)
@@ -43,6 +43,7 @@ import android.os.Message;
 import android.os.SystemClock;
 import android.provider.Browser;
 import android.speech.RecognizerResultsIntent;
+import android.text.TextUtils;
 import android.util.Log;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
@@ -1862,8 +1863,8 @@ class Tab {
     // Populate the picker data using the given history item and the current top
     // WebView.
     private void populatePickerData(WebHistoryItem item) {
-        mPickerData = new PickerData();
-        if (item != null) {
+        if (item != null && !TextUtils.isEmpty(item.getUrl())) {
+            mPickerData = new PickerData();
             mPickerData.mUrl = item.getUrl();
             mPickerData.mTitle = item.getTitle();
             mPickerData.mFavicon = item.getFavicon();
@@ -1950,7 +1951,6 @@ class Tab {
         // Restore the internal state even if the WebView fails to restore.
         // This will maintain the app id, original url and close-on-exit values.
         mSavedState = null;
-        mPickerData = null;
         mCloseOnExit = b.getBoolean(CLOSEONEXIT);
         mAppId = b.getString(APPID);
         mOriginalUrl = b.getString(ORIGINALURL);