Adds a CloneAndAnimate function to WindowManagerInternalClient
The idea is to clone an existing tree of views reusing the surface id
and run the animation on it. By doing this we effectively have a (visual) copy of the views that we can then run an animation on. Eg fade out, apply a transform... If reusing surface ids becomes problematic we could instead go with creating a pixel copy of the underyling surface and change the cloning not to recurse. That's an implementation detail that could be changed later on.
I don't think cloning is useful outside of animations and really only makes sense at the WM level. Hence going with a narrow API for now.
There are a number of other pieces that need to be implemented before this can be used, but this is a good starting point.
R=msw@chromium.org
BUG=434429
Review URL: https://codereview.chromium.org/720883003
diff --git a/mojo/services/view_manager/view_manager_service_impl.h b/mojo/services/view_manager/view_manager_service_impl.h
index 7395edd..d1f5987 100644
--- a/mojo/services/view_manager/view_manager_service_impl.h
+++ b/mojo/services/view_manager/view_manager_service_impl.h
@@ -65,12 +65,23 @@
// Returns true if this connection's root is |id|.
bool IsRoot(const ViewId& id) const;
+ // Returns the id of the root node. This is null if the root has been
+ // destroyed but the connection is still valid.
+ const ViewId* root() const { return root_.get(); }
+
// Invoked when a connection is about to be destroyed.
void OnWillDestroyViewManagerServiceImpl(ViewManagerServiceImpl* connection);
- // Synchronous implementation of ViewManagerService::CreateView(), see the
- // mojom for details.
+ // These functions are synchronous variants of those defined in the mojom. The
+ // ViewManagerService implementations all call into these. See the mojom for
+ // details.
ErrorCode CreateView(const ViewId& view_id);
+ bool AddView(const ViewId& parent_id, const ViewId& child_id);
+ std::vector<const ServerView*> GetViewTree(const ViewId& view_id) const;
+ bool SetViewVisibility(const ViewId& view_id, bool visible);
+ bool Embed(const std::string& url,
+ const ViewId& view_id,
+ InterfaceRequest<ServiceProvider> service_provider);
// The following methods are invoked after the corresponding change has been
// processed. They do the appropriate bookkeeping and update the client as