X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fcom%2Fandroid%2Fbrowser%2FBrowserActivity.java;h=24694082dcf310dd9ade370d92eaca90acfda97c;hb=003a5ddf3a7ff1b30bfd82cddc8da49cb9fedf15;hp=df80e99bdd0615b72d84c45d065eac56d9ca6d04;hpb=7d3ac79a202f0caf588e70270c28f5510ff80821;p=android-x86%2Fpackages-apps-Browser.git diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index df80e99..2469408 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -306,6 +306,14 @@ public class BrowserActivity extends Activity PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Browser"); + // Find out if the network is currently up. + ConnectivityManager cm = (ConnectivityManager) getSystemService( + Context.CONNECTIVITY_SERVICE); + NetworkInfo info = cm.getActiveNetworkInfo(); + if (info != null) { + mIsNetworkUp = info.isAvailable(); + } + /* enables registration for changes in network status from http stack */ mNetworkStateChangedFilter = new IntentFilter(); @@ -755,8 +763,8 @@ public class BrowserActivity extends Activity mTitleBar.setInVoiceMode(false); mFakeTitleBar.setInVoiceMode(false); - mTitleBar.setDisplayTitle(mTitle); - mFakeTitleBar.setDisplayTitle(mTitle); + mTitleBar.setDisplayTitle(mUrl); + mFakeTitleBar.setDisplayTitle(mUrl); } /* package */ static String fixUrl(String inUrl) { // FIXME: Converting the url to lower case @@ -2827,12 +2835,19 @@ public class BrowserActivity extends Activity hideFakeTitleBar(); } } - } else if (!mInLoad) { - // onPageFinished may have already been called but a subframe is - // still loading and updating the progress. Reset mInLoad and update - // the menu items. - mInLoad = true; - updateInLoadMenuItems(); + } else { + if (!mInLoad) { + // onPageFinished may have already been called but a subframe is + // still loading and updating the progress. Reset mInLoad and + // update the menu items. + mInLoad = true; + updateInLoadMenuItems(); + } + // When the page first begins to load, the Activity may still be + // paused, in which case showFakeTitleBar will do nothing. Call + // again as the page continues to load so that it will be shown. + // (Calling it will the fake title bar is already showing will also + // do nothing. if (!mOptionsMenuOpen || mIconView) { // This page has begun to load, so show the title bar showFakeTitleBar();