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

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

Issue 12045030: Merge 177774 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1364/src/
Patch Set: 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
===================================================================
--- content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (revision 178087)
+++ content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (working copy)
@@ -1354,7 +1354,6 @@
} else {
undoScrollFocusedEditableNodeIntoViewIfNeeded(false);
}
- mImeAdapter.dispatchKeyEventPreIme(event);
return mContainerViewInternals.super_dispatchKeyEventPreIme(event);
} finally {
TraceEvent.end();
@@ -1369,16 +1368,14 @@
!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