[go: nahoru, domu]

Make aura work with mus

The basic idea is to add the option of having aura work with mus. This is
done by way of adding a porting layer for aura::Window. Specifically
WindowPort. Each Window has a WindowPort. WindowPort is typically
created by aura::Window during Init() time (WindowPort may be
explicitly passed in the constructor, but that is not the common
case). If a WindowPort was not explicitly passed in the constructor
then Window calls to Env::CreateWindowPort to create the
WindowPort. Env gets a factory function for creation.

Window calls to WindowPort at key times that need to differ for mus,
or as a hook for mus to call to the server. For example,
Window::AddChild() calls to WindowPort::OnWillAddChild().

WindowPortMus calls to a class similar to ui::WindowTreeClient on on
any changes. WindowTreeClient forwards changes to the server as
appropriate. Changes originating from the server call to WindowMus
(implemented by WindowPortMus). The implementation of the functions in
WindowPortMus called by WindowTreeClient ensure calls made from
the server don't make their way back to the server. For example, we
don't want something like the following happening: WindowTreeClient is
told bounds change -> change bounds on window -> try to set bounds
change back to server.

Wiring up aura to use mus then becomes something like:
. Create WindowTreeClient (encapsulates connection to mus).
. Install factory on Env.

And then use aura like you normally would. You can see this in
AuraTestHelper.

This patch is huge and works, but there are a bunch of TODOs and a
handful of comment out code. I will be addressing this ASAP, but
wanted to land this for others.

BUG=none
TEST=none
R=sadrul@chromium.org

Review-Url: https://codereview.chromium.org/2445163002
Cr-Commit-Position: refs/heads/master@{#428031}
44 files changed