Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java

Issue 500043002: Added code to dismiss url suggestion popup on back key press. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java
diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java
index a88405063d3727f264b9f1226c9c57c1cb2bc31c..c04d8c57ec939c203c17858ff6f72aaf897bf5dd 100644
--- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java
+++ b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java
@@ -140,6 +140,19 @@ public class ChromeShellToolbar extends LinearLayout {
}
}
});
+ mUrlTextView.setOnKeyListener(new OnKeyListener() {
+ @Override
+ public boolean onKey(View v, int keyCode, KeyEvent event) {
+ if (event != null && keyCode == KeyEvent.KEYCODE_BACK) {
Bernhard Bauer 2014/08/26 07:46:10 Is this actually called with a null event?
ankit 2014/08/26 08:16:32 I did not encounter any scenario when it was getti
Bernhard Bauer 2014/08/26 08:20:43 I would rather not add it. Your assumption (and mi
+ mUrlTextView.clearFocus();
+ if (mTab != null) {
+ mTab.getView().requestFocus();
+ }
+ return true;
+ }
+ return false;
+ }
+ });
mSuggestionPopup = new SuggestionPopup(getContext(), mUrlTextView, this);
mUrlTextView.addTextChangedListener(mSuggestionPopup);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698