summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/NavigationBarPhone.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/browser/NavigationBarPhone.java')
-rw-r--r--src/com/android/browser/NavigationBarPhone.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/browser/NavigationBarPhone.java b/src/com/android/browser/NavigationBarPhone.java
index 8173377..49228db 100644
--- a/src/com/android/browser/NavigationBarPhone.java
+++ b/src/com/android/browser/NavigationBarPhone.java
@@ -128,11 +128,12 @@ public class NavigationBarPhone extends NavigationBarBase implements
*/
@Override
void setDisplayTitle(String title) {
+ mUrlInput.setTag(title);
if (!isEditingUrl()) {
if (title == null) {
mUrlInput.setText(R.string.new_tab);
} else {
- mUrlInput.setText(title);
+ mUrlInput.setText(UrlUtils.stripUrl(title), false);
}
mUrlInput.setSelection(0);
}
@@ -198,6 +199,18 @@ public class NavigationBarPhone extends NavigationBarBase implements
}
@Override
+ public void onFocusChange(View view, boolean hasFocus) {
+ if (view == mUrlInput) {
+ if (hasFocus) {
+ mUrlInput.setText((String) mUrlInput.getTag(), false);
+ } else {
+ setDisplayTitle(mUrlInput.getText().toString());
+ }
+ }
+ super.onFocusChange(view, hasFocus);
+ }
+
+ @Override
public void onStateChanged(int state) {
switch(state) {
case StateListener.STATE_NORMAL: