| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 [DartPackage="mojo_services"] |
| 6 module mojo.ui; |
| 7 |
| 8 import "mojo/services/ui/views/interfaces/views.mojom"; |
| 9 import "mojo/services/ui/views/interfaces/view_trees.mojom"; |
| 10 |
| 11 // The view manager is a service which manages trees of views. |
| 12 // |
| 13 // Before a view can be added to the view tree, it must first be registered |
| 14 // with the view manager. Once registered, the view receives a token as a |
| 15 // transferable reference to be provided to the view's intended container. |
| 16 interface ViewManager { |
| 17 // Registers a view with the view manager. |
| 18 // |
| 19 // When a view is registered, it receives its own host and a token |
| 20 // to identify it. |
| 21 // |
| 22 // The |view_host| is used to configure the view and interact with its |
| 23 // local environment. The view host is private to the view and should |
| 24 // not be shared with anyone else. |
| 25 // |
| 26 // The |view_token| is used as a transferable reference which can |
| 27 // be passed to the view's intended container as part of a request to |
| 28 // add the view as a child. The view manager itself does not describe |
| 29 // how this interaction should take place, only that the token should |
| 30 // eventually be passed back through the container's view host interface |
| 31 // as an argument to AddChild(). |
| 32 // |
| 33 // To unregister the view and cause it to be removed from the view tree, |
| 34 // simply close the |view_host| message pipe. |
| 35 RegisterView(mojo.ui.View view, |
| 36 mojo.ui.ViewHost& view_host) => |
| 37 (mojo.ui.ViewToken view_token); |
| 38 |
| 39 // Registers a view tree with the view manager. |
| 40 // |
| 41 // The |view_tree_host| is used to configure the view tree and interact |
| 42 // with the views it contains. The view tree host is private to the view |
| 43 // and should not be shared with anyone else. |
| 44 // |
| 45 // To unregister the view tree simply close the |view_tree_host| message pipe. |
| 46 RegisterViewTree(mojo.ui.ViewTree view_tree, |
| 47 mojo.ui.ViewTreeHost& view_tree_host) => (); |
| 48 }; |
| OLD | NEW |