I took a brief look at aura/mus version of WCV/RWHV, and verified that they also own a native view (aura::Window and ui::Window, respectively) which form a hierarchy just like ViewAndroid instances do in Clank. This clearly indicates that sievers@ used other platforms as reference when extending ViewAndroid.{aura, ui}::Window are closer to the abstraction of view used in in underlying platform - i.e. it was designed to handle stacked structure of views, visibility, size, layout, hit test, etc, and often forms a recursive flow to find the right window in the hierarchy or dispatch notification to all the elements in the tree.There is no handlers for mouse/key/motion events there. It makes me think that the association of key events and view is somewhat unique on Android platform.
I reopened https://codereview.chromium.org/2502763003/ to outline the idea on how ViewAndroid is used to forward calls down to native based on the discussion we had. Note that the dispatch still starts from ViewAndroidDelegate to top ViewAndroid rather than from WindowAndroid
since boliu@ later found that WebView instances all share one WindowAndroid object, which makes it hard to dispatch the event to the intended ViewAndroid - he said he would think about it.
On Thursday, November 17, 2016 at 10:46:47 AM UTC+9, Alexandre Elias wrote:Slimming Clank is the working group to clean up cruft in Android-specific (Clank and WebView) code in content/browser/, ui/, and (later) chrome/. We aim for net negative lines of code, and to establish clear dependencies, lifetimes, and lines of authority.We had a syncup of what everyone is working on. jinsukkim@ has been working on ActionMode, mdjones@ on viewport simplification (design doc), amaralp@ on mouse and selection logic, aelias@ on thumbnail layers and background color, rlanday@ on swipe refresh handler, changwan@ on IME, wychen@ on drag-and-drop events. There were a few design discussions to come out of that:1. ViewAndroid/WindowAndroid hierarchy. We agreed input events should go from the embedder to WindowAndroid, which should resolve positions forward to ViewAndroid, which then are forwarded to individual web contents or Blimp contents via a base class interface called something like ViewClient. (This will invert the current flow where events go directly from embedder to ContentViewCore and from there to views.)Action item for follow-up: research how Aura structures input event and resize forwarding and (probably) match the model.2. IME and focus behavior. We agreed to try to detach IME and focus-related objects almost completely from the main blob of Android embedder objects and have it held on the side by the WebContents instead. (Although IME APIs force us arbitrarily to use an Android View, it has no need to be attached to the main View hierarchy.)
--
You received this message because you are subscribed to the Google Groups "Slimming Clank" group.
To unsubscribe from this group and stop receiving emails from it, send an email to slimming-clank+unsubscribe@chromium.org.
To post to this group, send email to slimmin...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/slimming-clank/e45e481d-63bc-408f-b91b-a72265dfe057%40chromium.org.
On Sun, Nov 20, 2016 at 10:24 PM, 'Jinsuk Kim' via Slimming Clank <slimmin...@chromium.org> wrote:I took a brief look at aura/mus version of WCV/RWHV, and verified that they also own a native view (aura::Window and ui::Window, respectively) which form a hierarchy just like ViewAndroid instances do in Clank. This clearly indicates that sievers@ used other platforms as reference when extending ViewAndroid.{aura, ui}::Window are closer to the abstraction of view used in in underlying platform - i.e. it was designed to handle stacked structure of views, visibility, size, layout, hit test, etc, and often forms a recursive flow to find the right window in the hierarchy or dispatch notification to all the elements in the tree.There is no handlers for mouse/key/motion events there. It makes me think that the association of key events and view is somewhat unique on Android platform.ui::EventHandler (implemented by ui::WindowDelegate which is implemented by RenderWidgetHostViewAura) is how input event is passed from aura layer to content layer.I reopened https://codereview.chromium.org/2502763003/ to outline the idea on how ViewAndroid is used to forward calls down to native based on the discussion we had. Note that the dispatch still starts from ViewAndroidDelegate to top ViewAndroid rather than from WindowAndroidDelegate is still wrong though. Delegate (or whatever it will be named) is used to talk from ui to upper layer, not the other way around.
--
You received this message because you are subscribed to the Google Groups "Slimming Clank" group.
To unsubscribe from this group and stop receiving emails from it, send an email to slimming-clank+unsubscribe@chromium.org.
To post to this group, send email to slimmin...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/slimming-clank/816901f5-9afa-4814-8f4c-1173a36ef3b1%40chromium.org.
> The only way I see this working is webview has the ability to pick out the right ViewAndroid (that's owned by WebContentsViewAndroid), and either forward the event directly to that ViewAndroid, or have some way to tell WindowAndroid to directly forward to that child.though I guess that's not enough detail.Ideally webview code creates the ViewAndroid and set it WebContentsAndroid, then can hold a pointer to it, and forward events. But that means potentially duplicating the java->native code, since we don't want a java ViewAndroid.Or, can get ViewAndroid from WebContentsAndroid, but that has the same java->native issue.Or do some hack that forces WindowAndroid to forward to the correct child, but I don't see how that really works.So perhaps should solve the java->native issue, eg ViewAndroid create a java object that does the event forwarding to itself.That's a lot of rambling.. not sure if it's clear. Also maybe others have better ideas..
> The only way I see this working is webview has the ability to pick out the right ViewAndroid (that's owned by WebContentsViewAndroid), and either forward the event directly to that ViewAndroid, or have some way to tell WindowAndroid to directly forward to that child.though I guess that's not enough detail.Ideally webview code creates the ViewAndroid and set it WebContentsAndroid, then can hold a pointer to it, and forward events. But that means potentially duplicating the java->native code, since we don't want a java ViewAndroid.Or, can get ViewAndroid from WebContentsAndroid, but that has the same java->native issue.Or do some hack that forces WindowAndroid to forward to the correct child, but I don't see how that really works.So perhaps should solve the java->native issue, eg ViewAndroid create a java object that does the event forwarding to itself.That's a lot of rambling.. not sure if it's clear. Also maybe others have better ideas..I think it is possible by having ViewAndroidDelegate provide a Java API returninga token associated withtheViewAndroid owned by WCVA .
Callsites then invoke WindowAndroid.onPhysicalBackingSizeChanged(token, width, height). WindowAndroid needs to make sure the passed token is associated with one of its children,find the matching VA, and forward the call down. WIndowAndroid also needs to maintain a mapof token-> struct ViewData where it needs to keepVA*, view-related parameters like physical backing size, top control height, etc. which are currently maintained by CVC. The map entry will be deleted when the corresponding child VA is removed from WA.
I'll try this idea if it sounds plausible. Let me have your thought.
--
You received this message because you are subscribed to the Google Groups "Slimming Clank" group.
To unsubscribe from this group and stop receiving emails from it, send an email to slimming-clank+unsubscribe@chromium.org.
To post to this group, send email to slimmin...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/slimming-clank/CAC4m%2BbGzLHZtymg4o%3DFt4ZnAE%3DAch1G3%2BS7OcdOY946iH3HpPg%40mail.gmail.com.