Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Side by Side Diff: mojo/services/ui/views/interfaces/view_manager.mojom

Issue 1679023006: Reify view ownership as a message pipe. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 };
OLDNEW
« no previous file with comments | « mojo/dart/packages/mojo_services/lib/mojo/ui/views.mojom.dart ('k') | mojo/services/ui/views/interfaces/view_provider.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698