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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 11914003: Start sending synthetic keyevents for enter and tab in Android IME (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 11 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 | content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index e1b3417a6b83399f0e2047886d6350753b35347e..58c3ac9e8f7d8afe972dc9139dea05a5dbd2fabf 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -1408,7 +1408,6 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient {
} else {
undoScrollFocusedEditableNodeIntoViewIfNeeded(false);
}
- mImeAdapter.dispatchKeyEventPreIme(event);
return mContainerViewInternals.super_dispatchKeyEventPreIme(event);
} finally {
TraceEvent.end();
@@ -1423,16 +1422,14 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient {
!mImeAdapter.isNativeImeAdapterAttached() && mNativeContentViewCore != 0) {
mImeAdapter.attach(nativeGetNativeImeAdapter(mNativeContentViewCore));
}
- // The key handling logic is kind of confusing here.
- // The purpose of shouldOverrideKeyEvent() is to filter out some keys that is critical
- // to browser function but useless in renderer process (for example, the back button),
- // so the browser can still respond to these keys in a timely manner when the renderer
- // process is busy/blocked/busted. mImeAdapter.dispatchKeyEvent() forwards the key event
- // to the renderer process. If mImeAdapter is bypassed or is not interested to the event,
- // fall back to the default dispatcher to propagate the event to sub-views.
- return (!getContentViewClient().shouldOverrideKeyEvent(event)
- && mImeAdapter.dispatchKeyEvent(event))
- || mContainerViewInternals.super_dispatchKeyEvent(event);
+
+ if (getContentViewClient().shouldOverrideKeyEvent(event)) {
+ return mContainerViewInternals.super_dispatchKeyEvent(event);
+ }
+
+ if (mKeyboardConnected && mImeAdapter.dispatchKeyEvent(event)) return true;
+
+ return mContainerViewInternals.super_dispatchKeyEvent(event);
}
/**
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/ImeAdapter.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698