| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 [DartPackage="mojo_services"] | 5 [DartPackage="mojo_services"] |
| 6 module mojo.ui; | 6 module mojo.ui; |
| 7 | 7 |
| 8 import "mojo/services/ui/views/interfaces/views.mojom"; | 8 import "mojo/services/ui/views/interfaces/views.mojom"; |
| 9 import "mojo/services/ui/views/interfaces/view_associates.mojom"; | 9 import "mojo/services/ui/views/interfaces/view_associates.mojom"; |
| 10 import "mojo/services/ui/views/interfaces/view_trees.mojom"; | 10 import "mojo/services/ui/views/interfaces/view_trees.mojom"; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 interface ViewManager { | 21 interface ViewManager { |
| 22 // Registers a view with the view manager. | 22 // Registers a view with the view manager. |
| 23 // | 23 // |
| 24 // When a view is registered, it receives its own host and a token | 24 // When a view is registered, it receives its own host and a token |
| 25 // to identify it. | 25 // to identify it. |
| 26 // | 26 // |
| 27 // The |view_host| is used to configure the view and interact with its | 27 // The |view_host| is used to configure the view and interact with its |
| 28 // local environment. The view host is private to the view and should | 28 // local environment. The view host is private to the view and should |
| 29 // not be shared with anyone else. | 29 // not be shared with anyone else. |
| 30 // | 30 // |
| 31 // The |view_token| is used as a transferable reference which can | 31 // The |view_owner| is used as a transferable reference which can |
| 32 // be passed to the view's intended container as part of a request to | 32 // be passed to the view's intended container as part of a request to |
| 33 // add the view as a child. The view manager itself does not describe | 33 // add the view as a child. The view manager itself does not describe |
| 34 // how this interaction should take place, only that the token should | 34 // how this interaction should take place, only that ownership should |
| 35 // eventually be passed back through the container's view host interface | 35 // eventually be passed back through the container's view host interface |
| 36 // as an argument to AddChild(). | 36 // as an argument to |ViewHost.AddChild()|. |
| 37 // | 37 // |
| 38 // The |label| is an optional name to associate with the view for | 38 // The |label| is an optional name to associate with the view for |
| 39 // diagnostic purposes. The label will be truncated if it is longer | 39 // diagnostic purposes. The label will be truncated if it is longer |
| 40 // than |kLabelMaxLength|. | 40 // than |kLabelMaxLength|. |
| 41 // | 41 // |
| 42 // To unregister the view and cause it to be removed from the view tree, | 42 // To unregister the view and cause it to be removed from the view tree, |
| 43 // simply close the |view| and/or |view_host| message pipes. | 43 // simply close the |view|, |view_host|, or |view_owner| message pipes. |
| 44 // |
| 45 // TODO(jeffbrown): Refactor this so View becomes a ViewListener, |
| 46 // ViewHost becomes View, and there are only two pipes here. |
| 44 RegisterView(mojo.ui.View view, | 47 RegisterView(mojo.ui.View view, |
| 45 mojo.ui.ViewHost& view_host, | 48 mojo.ui.ViewHost& view_host, |
| 46 string? label) => (mojo.ui.ViewToken view_token); | 49 mojo.ui.ViewOwner& view_owner, |
| 50 string? label); |
| 47 | 51 |
| 48 // Registers a view tree with the view manager. | 52 // Registers a view tree with the view manager. |
| 49 // | 53 // |
| 50 // The |view_tree_host| is used to configure the view tree and interact | 54 // The |view_tree_host| is used to configure the view tree and interact |
| 51 // with the views it contains. The view tree host is private to the view | 55 // with the views it contains. The view tree host is private to the view |
| 52 // and should not be shared with anyone else. | 56 // and should not be shared with anyone else. |
| 53 // | 57 // |
| 54 // The |label| is an optional name to associate with the view tree for | 58 // The |label| is an optional name to associate with the view tree for |
| 55 // diagnostic purposes. The label will be truncated if it is longer | 59 // diagnostic purposes. The label will be truncated if it is longer |
| 56 // than |kLabelMaxLength|. | 60 // than |kLabelMaxLength|. |
| 57 // | 61 // |
| 58 // The |view_tree_token| is used as a transferable reference which can | 62 // The |view_tree_token| is used as a transferable reference which can |
| 59 // be passed to trusted services to reference the view tree. | 63 // be passed to trusted services to reference the view tree. |
| 60 // | 64 // |
| 61 // To unregister the view tree simply close the |view_tree| and/or | 65 // To unregister the view tree simply close the |view_tree| and/or |
| 62 // |view_tree_host| message pipes. | 66 // |view_tree_host| message pipes. |
| 63 RegisterViewTree(mojo.ui.ViewTree view_tree, | 67 RegisterViewTree(mojo.ui.ViewTree view_tree, |
| 64 mojo.ui.ViewTreeHost& view_tree_host, | 68 mojo.ui.ViewTreeHost& view_tree_host, |
| 65 string? label) => (mojo.ui.ViewTreeToken view_tree_token); | 69 string? label); |
| 66 }; | 70 }; |
| OLD | NEW |