Merge change 7914
* changes:
Fix 1990635. update() was accidentally removed. Bring it back so that the WebSettings will be applied to the current open windows.
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index da950ed..d148c0a 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -1553,7 +1553,7 @@
@Override
public boolean onSearchRequested() {
String url = getTopWindow().getUrl();
- startSearch(mSettings.getHomePage().equals(url) ? null : url, false,
+ startSearch(mSettings.getHomePage().equals(url) ? null : url, true,
createGoogleSearchSourceBundle(GOOGLE_SEARCH_SOURCE_SEARCHKEY), false);
return true;
}
diff --git a/src/com/android/browser/TitleBar.java b/src/com/android/browser/TitleBar.java
index b818dd2..f534a03 100644
--- a/src/com/android/browser/TitleBar.java
+++ b/src/com/android/browser/TitleBar.java
@@ -39,6 +39,7 @@
private ImageView mFavicon;
private ImageView mLockIcon;
private boolean mInLoad;
+ private boolean mTitleSet;
public TitleBar(Context context) {
this(context, null);
@@ -112,6 +113,11 @@
mRtButton.setVisibility(View.VISIBLE);
mLftButton.setImageDrawable(mBookmarkDrawable);
mInLoad = false;
+ if (!mTitleSet) {
+ mTitle.setText(mUrl.getText());
+ mUrl.setText(null);
+ mTitleSet = true;
+ }
} else {
mCircularProgress.setProgress(newProgress);
mHorizontalProgress.setProgress(newProgress);
@@ -132,14 +138,25 @@
}
/* package */ void setTitleAndUrl(CharSequence title, CharSequence url) {
- if (null == title) {
- mTitle.setText(R.string.title_bar_loading);
- } else {
- mTitle.setText(title);
- }
if (url != null) {
url = BrowserActivity.buildTitleUrl(url.toString());
}
+ if (null == title) {
+ if (mInLoad) {
+ mTitleSet = false;
+ mTitle.setText(R.string.title_bar_loading);
+ } else {
+ // If the page has no title, put the url in the title space
+ // and leave the url blank.
+ mTitle.setText(url);
+ mUrl.setText(null);
+ mTitleSet = true;
+ return;
+ }
+ } else {
+ mTitle.setText(title);
+ mTitleSet = true;
+ }
mUrl.setText(url);
}