OSDN Git Service

Only show the host portion of the url in the title bar.
authorLeon Scroggins <scroggo@google.com>
Thu, 11 Jun 2009 14:26:34 +0000 (10:26 -0400)
committerLeon Scroggins <scroggo@google.com>
Thu, 11 Jun 2009 17:18:23 +0000 (13:18 -0400)
For security reasons, we want to ensure that the domain
name of the current page is being shown in the title bar.
Use BrowserActivity's method of building the url for the
title bar, which also shows https if it is a secure site.

src/com/android/browser/BrowserActivity.java
src/com/android/browser/TitleBar.java

index d7f3910..5e236c5 100644 (file)
@@ -2518,7 +2518,7 @@ public class BrowserActivity extends Activity
      * or an empty string if, for example, the URL in question is a
      * file:// URL with no hostname.
      */
-    private static String buildTitleUrl(String url) {
+    /* package */ static String buildTitleUrl(String url) {
         String titleUrl = null;
 
         if (url != null) {
index f43058b..fdcab3c 100644 (file)
@@ -137,7 +137,7 @@ public class TitleBar extends LinearLayout {
         } else {
             mTitle.setText(title);
         }
-        mUrl.setText(url);
+        mUrl.setText(BrowserActivity.buildTitleUrl(url.toString()));
     }
 
     /* package */ void setToTabPicker() {