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 #ifndef SERVICES_UI_VIEW_MANAGER_VIEW_REGISTRY_H_ | 5 #ifndef SERVICES_UI_VIEW_MANAGER_VIEW_REGISTRY_H_ |
6 #define SERVICES_UI_VIEW_MANAGER_VIEW_REGISTRY_H_ | 6 #define SERVICES_UI_VIEW_MANAGER_VIEW_REGISTRY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 mojo::InterfaceRequest<mojo::gfx::composition::Scene> scene); | 66 mojo::InterfaceRequest<mojo::gfx::composition::Scene> scene); |
67 | 67 |
68 // Requests layout. | 68 // Requests layout. |
69 // Destroys |view_state| if an error occurs. | 69 // Destroys |view_state| if an error occurs. |
70 void RequestLayout(ViewState* view_state); | 70 void RequestLayout(ViewState* view_state); |
71 | 71 |
72 // Adds a child, reparenting it if necessary. | 72 // Adds a child, reparenting it if necessary. |
73 // Destroys |parent_state| if an error occurs. | 73 // Destroys |parent_state| if an error occurs. |
74 void AddChild(ViewState* parent_state, | 74 void AddChild(ViewState* parent_state, |
75 uint32_t child_key, | 75 uint32_t child_key, |
76 mojo::ui::ViewOwnerPtr child_view_owner); | 76 mojo::InterfaceHandle<mojo::ui::ViewOwner> child_view_owner); |
77 | 77 |
78 // Removes a child. | 78 // Removes a child. |
79 // Destroys |parent_state| if an error occurs. | 79 // Destroys |parent_state| if an error occurs. |
80 void RemoveChild(ViewState* parent_state, | 80 void RemoveChild(ViewState* parent_state, |
81 uint32_t child_key, | 81 uint32_t child_key, |
82 mojo::InterfaceRequest<mojo::ui::ViewOwner> | 82 mojo::InterfaceRequest<mojo::ui::ViewOwner> |
83 transferred_view_owner_request); | 83 transferred_view_owner_request); |
84 | 84 |
85 // Lays out a child and optionally provides its size. | 85 // Lays out a child and optionally provides its size. |
86 // Destroys |parent_state| if an error occurs. | 86 // Destroys |parent_state| if an error occurs. |
(...skipping 14 matching lines...) Expand all Loading... |
101 // VIEW TREE HOST REQUESTS | 101 // VIEW TREE HOST REQUESTS |
102 | 102 |
103 // Requests layout. | 103 // Requests layout. |
104 // Destroys |tree_state| if an error occurs. | 104 // Destroys |tree_state| if an error occurs. |
105 void RequestLayout(ViewTreeState* tree_state); | 105 void RequestLayout(ViewTreeState* tree_state); |
106 | 106 |
107 // Sets the root of the view tree. | 107 // Sets the root of the view tree. |
108 // Destroys |tree_state| if an error occurs. | 108 // Destroys |tree_state| if an error occurs. |
109 void SetRoot(ViewTreeState* tree_state, | 109 void SetRoot(ViewTreeState* tree_state, |
110 uint32_t root_key, | 110 uint32_t root_key, |
111 mojo::ui::ViewOwnerPtr root_view_owner); | 111 mojo::InterfaceHandle<mojo::ui::ViewOwner> root_view_owner); |
112 | 112 |
113 // Resets the root of the view tree. | 113 // Resets the root of the view tree. |
114 // Destroys |tree_state| if an error occurs. | 114 // Destroys |tree_state| if an error occurs. |
115 void ResetRoot(ViewTreeState* tree_state, | 115 void ResetRoot(ViewTreeState* tree_state, |
116 mojo::InterfaceRequest<mojo::ui::ViewOwner> | 116 mojo::InterfaceRequest<mojo::ui::ViewOwner> |
117 transferred_view_owner_request); | 117 transferred_view_owner_request); |
118 | 118 |
119 // Lays out a view tree's root and optionally provides its size. | 119 // Lays out a view tree's root and optionally provides its size. |
120 // Destroys |tree_state| if an error occurs. | 120 // Destroys |tree_state| if an error occurs. |
121 void LayoutRoot(ViewTreeState* tree_state, | 121 void LayoutRoot(ViewTreeState* tree_state, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 uint32_t next_view_tree_token_value_ = 1u; | 193 uint32_t next_view_tree_token_value_ = 1u; |
194 std::unordered_map<uint32_t, ViewState*> views_by_token_; | 194 std::unordered_map<uint32_t, ViewState*> views_by_token_; |
195 std::unordered_map<uint32_t, ViewTreeState*> view_trees_by_token_; | 195 std::unordered_map<uint32_t, ViewTreeState*> view_trees_by_token_; |
196 | 196 |
197 DISALLOW_COPY_AND_ASSIGN(ViewRegistry); | 197 DISALLOW_COPY_AND_ASSIGN(ViewRegistry); |
198 }; | 198 }; |
199 | 199 |
200 } // namespace view_manager | 200 } // namespace view_manager |
201 | 201 |
202 #endif // SERVICES_UI_VIEW_MANAGER_VIEW_REGISTRY_H_ | 202 #endif // SERVICES_UI_VIEW_MANAGER_VIEW_REGISTRY_H_ |
OLD | NEW |