Commit ced57b72 authored by Ben Murdoch's avatar Ben Murdoch Committed by The Android Automerger
Browse files

Cherry pick [Android] Support unfocusable container views.

This solves the S-Pen selection problem for GMail in M37.

Bug: 18066784,18726212

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}
(cherry picked from commit f66cc3b6)
parent d5b91964
......@@ -2613,7 +2613,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();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment