summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedchoc@chromium.org <tedchoc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-13 19:29:07 +0000
committertedchoc@chromium.org <tedchoc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-13 19:29:07 +0000
commit3533888bec5ae6fae5ed4cdb922de10043766771 (patch)
tree21b9f646da2b4e5b1dd0a73ccdc0ba152488f7a6
parentee8b3ec1cc56fe535329ebb27f7cd3eb48e1c50f (diff)
downloadchromium_src-3533888bec5ae6fae5ed4cdb922de10043766771.zip
chromium_src-3533888bec5ae6fae5ed4cdb922de10043766771.tar.gz
chromium_src-3533888bec5ae6fae5ed4cdb922de10043766771.tar.bz2
Focus content view on startup. Replace URL when unfocusing.
BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10735079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146618 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/shell/android/java/src/org/chromium/content_shell/ShellView.java6
-rw-r--r--content/shell/android/res/layout/shell_view.xml1
2 files changed, 6 insertions, 1 deletions
diff --git a/content/shell/android/java/src/org/chromium/content_shell/ShellView.java b/content/shell/android/java/src/org/chromium/content_shell/ShellView.java
index ad8860a..27fd321 100644
--- a/content/shell/android/java/src/org/chromium/content_shell/ShellView.java
+++ b/content/shell/android/java/src/org/chromium/content_shell/ShellView.java
@@ -79,7 +79,7 @@ public class ShellView extends LinearLayout {
}
loadUrl(mUrlTextView.getText().toString());
setKeyboardVisibilityForUrl(false);
- mUrlTextView.clearFocus();
+ mContentView.requestFocus();
return true;
}
});
@@ -89,6 +89,9 @@ public class ShellView extends LinearLayout {
setKeyboardVisibilityForUrl(hasFocus);
mNextButton.setVisibility(hasFocus ? GONE : VISIBLE);
mPrevButton.setVisibility(hasFocus ? GONE : VISIBLE);
+ if (!hasFocus) {
+ mUrlTextView.setText(mContentView.getUrl());
+ }
}
});
}
@@ -153,6 +156,7 @@ public class ShellView extends LinearLayout {
new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.MATCH_PARENT));
+ mContentView.requestFocus();
}
/**
diff --git a/content/shell/android/res/layout/shell_view.xml b/content/shell/android/res/layout/shell_view.xml
index b3eeee1..05dca52 100644
--- a/content/shell/android/res/layout/shell_view.xml
+++ b/content/shell/android/res/layout/shell_view.xml
@@ -26,6 +26,7 @@
android:autoText="true"
android:capitalize="sentences"
android:singleLine="true"
+ android:selectAllOnFocus="true"
android:hint="@string/url_hint"
android:inputType="textUri"
android:imeOptions="actionGo" />