New issue
Advanced search Search tips

Issue 746099 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

RenderWidgetHostViewAndroid::Focus is wrong

Project Member Reported by boliu@chromium.org, Jul 19 2017

Issue description

RenderWidgetHostViewAndroid::Focus is content requesting android to make the native view backing this widget focused. Then as a response (if successful), can call host->GotFocus(). On android ContentViewCore is currently acting as the "native view".

The current implementation is broken. It just shortcuts back to host without talking to CVC at all. I think at minimum, we should make sure rwhva/rwh focus state stays in sync with CVC, rather than lying to rwh that it always gets focus whenever requested.

Of course if we can actually implement real "request focus", it would be better.

This is changing existing behavior though, so could have subtle effects elsewhere unfortunately
 
It would be useful to know what the actual thing to do to get the RWHVA::Focus() to work. Does the implementation of ContentViewCore.requestFocus() do what rwhva/rwh expects? It is a void method but the value to return is available from android.view.requestFocus().

Comment 2 by boliu@chromium.org, Jul 24 2017

Well, the expectation is:
"""
RenderWidgetHostViewAndroid::Focus is content requesting android to make the native view backing this widget focused. Then as a response (if successful), can call host->GotFocus().
"""

so call requestFocus on the container view. then when view received focus, call back down to host->GotFocus

hopefully that doesn't break anything..
Cc: -jinsuk...@chromium.org boliu@chromium.org
Owner: jinsuk...@chromium.org
Status: Assigned (was: Untriaged)
Thanks. I'll do that and see what it breaks : )
Project Member

Comment 4 by bugdroid1@chromium.org, Aug 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/74b8a0a5ebfe5dc1a1dcd5c0a6ac62e68f8a787f

commit 74b8a0a5ebfe5dc1a1dcd5c0a6ac62e68f8a787f
Author: Jinsuk Kim <jinsukkim@chromium.org>
Date: Thu Aug 10 05:16:36 2017

Keep RenderWidgetHostView focus state in sync with Content

Previously, the request |RWHVA::Focus()| on Android was not propagated
to the content native view but simply shortcut back to the host,
which is not correct. This CL requests focus on the container view
upon request from RWHVA, and reflects the result accordinly.

BUG= 746099 

Change-Id: I87d6be654049787331f73a5ac30ea6cebf13d6b3
Reviewed-on: https://chromium-review.googlesource.com/583412
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493252}
[modify] https://crrev.com/74b8a0a5ebfe5dc1a1dcd5c0a6ac62e68f8a787f/content/browser/android/content_view_core.cc
[modify] https://crrev.com/74b8a0a5ebfe5dc1a1dcd5c0a6ac62e68f8a787f/content/browser/android/content_view_core.h
[modify] https://crrev.com/74b8a0a5ebfe5dc1a1dcd5c0a6ac62e68f8a787f/content/browser/renderer_host/render_widget_host_view_android.cc
[modify] https://crrev.com/74b8a0a5ebfe5dc1a1dcd5c0a6ac62e68f8a787f/content/public/android/BUILD.gn
[modify] https://crrev.com/74b8a0a5ebfe5dc1a1dcd5c0a6ac62e68f8a787f/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
[delete] https://crrev.com/1b8abc019a5b476d503bff7405120c44036799eb/content/public/android/java/src/org/chromium/content/browser/ViewUtils.java
[modify] https://crrev.com/74b8a0a5ebfe5dc1a1dcd5c0a6ac62e68f8a787f/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
[modify] https://crrev.com/74b8a0a5ebfe5dc1a1dcd5c0a6ac62e68f8a787f/ui/android/BUILD.gn
[modify] https://crrev.com/74b8a0a5ebfe5dc1a1dcd5c0a6ac62e68f8a787f/ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java
[add] https://crrev.com/74b8a0a5ebfe5dc1a1dcd5c0a6ac62e68f8a787f/ui/android/java/src/org/chromium/ui/base/ViewUtils.java
[modify] https://crrev.com/74b8a0a5ebfe5dc1a1dcd5c0a6ac62e68f8a787f/ui/android/view_android.cc
[modify] https://crrev.com/74b8a0a5ebfe5dc1a1dcd5c0a6ac62e68f8a787f/ui/android/view_android.h

Status: Fixed (was: Assigned)

Sign in to add a comment