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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java

Issue 2108333003: Ensuring BACK key is getting passed to IMM before handling by Omnibox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
index 919809bcb22e566088a99d73773d285efa200e8d..45dae29e8e5065e339be25b7368e366fd0a49970 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
@@ -23,6 +23,7 @@ import android.view.GestureDetector;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
+import android.view.View.OnKeyListener;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -51,7 +52,7 @@ import java.net.URL;
/**
* The URL text entry view for the Omnibox.
*/
-public class UrlBar extends VerticallyFixedEditText {
+public class UrlBar extends VerticallyFixedEditText implements OnKeyListener {
private static final String TAG = "UrlBar";
// TextView becomes very slow on long strings, so we limit maximum length
@@ -224,6 +225,7 @@ public class UrlBar extends VerticallyFixedEditText {
mAccessibilityManager =
(AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
+ setOnKeyListener(this);
}
/**
@@ -507,10 +509,9 @@ public class UrlBar extends VerticallyFixedEditText {
}
@Override
- public boolean onKeyPreIme(int keyCode, KeyEvent event) {
+ public boolean onKey(View v, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
- if (event.getAction() == KeyEvent.ACTION_DOWN
- && event.getRepeatCount() == 0) {
+ if (event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount() == 0) {
// Tell the framework to start tracking this event.
getKeyDispatcherState().startTracking(event, this);
return true;
@@ -522,7 +523,7 @@ public class UrlBar extends VerticallyFixedEditText {
}
}
}
- return super.onKeyPreIme(keyCode, event);
+ return false;
}
@Override
« 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