diff options
author | Ben Murdoch <benm@google.com> | 2014-11-12 18:48:37 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2014-11-12 18:48:37 +0000 |
commit | f66cc3b6f091903a97b577e413da0c2acd80d3b7 (patch) | |
tree | 0f4a3b48572f3aaefd9bce95da208b4554bc0868 | |
parent | e578b2d213c837aab9cea5407d30f5c84065cd0e (diff) | |
download | chromium_org-f66cc3b6f091903a97b577e413da0c2acd80d3b7.tar.gz |
Cherry pick [Android] Support unfocusable container views.
Bug: 18066784
Original change description:
If the ContentViewCore container view is not focusable (which can
happen when it's emebedded in an app via android webview), we
were clearing the RWHVA notion of focus when the RenderView was
swapped out. As the view is never focusable again, chromium never
considers this view focused and as such, text selection did not
function.
We support this type of container view by always treating it focused
from Chromium's point of view.
BUG=430859
(internal b/18066784)
Change-Id: If08372c93ff0c87b483f0b408f04247764db2c56
Committed: https://crrev.com/9074d9fc9119ef4d2223f6c993d1a1b67a0bea7c
Cr-Commit-Position: refs/heads/master@{#303071}
-rw-r--r-- | content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java | 5 |
1 files changed, 4 insertions, 1 deletions
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 dc18f6e950..001238487c 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 @@ -2333,7 +2333,10 @@ public class ContentViewCore * @see View#hasFocus() */ @CalledByNative - public boolean hasFocus() { + private boolean hasFocus() { + // If the container view is not focusable, we consider it always focused from + // Chromium's point of view. + if (!mContainerView.isFocusable()) return true; return mContainerView.hasFocus(); } |