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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 129 |
130 // Connects to a view service. | 130 // Connects to a view service. |
131 // Destroys |view_state| if an error occurs. | 131 // Destroys |view_state| if an error occurs. |
132 void ConnectToViewTreeService(ViewTreeState* tree_state, | 132 void ConnectToViewTreeService(ViewTreeState* tree_state, |
133 const mojo::String& service_name, | 133 const mojo::String& service_name, |
134 mojo::ScopedMessagePipeHandle client_handle); | 134 mojo::ScopedMessagePipeHandle client_handle); |
135 | 135 |
136 // Called when one of the view tree pipes is closed remotely. | 136 // Called when one of the view tree pipes is closed remotely. |
137 void OnViewTreeDied(ViewTreeState* tree_state, const std::string& reason); | 137 void OnViewTreeDied(ViewTreeState* tree_state, const std::string& reason); |
138 | 138 |
| 139 // VIEW INSPECTOR REQUESTS |
| 140 |
| 141 void GetHitTester(mojo::ui::ViewTreeTokenPtr view_tree_token, |
| 142 mojo::InterfaceRequest<mojo::gfx::composition::HitTester> |
| 143 hit_tester_request, |
| 144 const GetHitTesterCallback& callback) override; |
| 145 |
| 146 void ResolveScenes( |
| 147 mojo::Array<mojo::gfx::composition::SceneTokenPtr> scene_tokens, |
| 148 const ResolveScenesCallback& callback) override; |
| 149 |
139 private: | 150 private: |
140 // LIFETIME | 151 // LIFETIME |
141 | 152 |
142 void UnregisterView(ViewState* view_state); | 153 void UnregisterView(ViewState* view_state); |
143 void UnregisterViewTree(ViewTreeState* tree_state); | 154 void UnregisterViewTree(ViewTreeState* tree_state); |
144 | 155 |
145 // TREE MANIPULATION | 156 // TREE MANIPULATION |
146 | 157 |
147 ViewState* FindView(uint32_t view_token_value); | 158 ViewState* FindView(uint32_t view_token_value); |
148 ViewTreeState* FindViewTree(uint32_t view_tree_token_value); | 159 ViewTreeState* FindViewTree(uint32_t view_tree_token_value); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 bool IsViewTreeStateRegisteredDebug(ViewTreeState* tree_state) { | 207 bool IsViewTreeStateRegisteredDebug(ViewTreeState* tree_state) { |
197 return tree_state && FindViewTree(tree_state->view_tree_token()->value); | 208 return tree_state && FindViewTree(tree_state->view_tree_token()->value); |
198 } | 209 } |
199 | 210 |
200 mojo::gfx::composition::CompositorPtr compositor_; | 211 mojo::gfx::composition::CompositorPtr compositor_; |
201 ViewAssociateTable associate_table_; | 212 ViewAssociateTable associate_table_; |
202 | 213 |
203 uint32_t next_view_token_value_ = 1u; | 214 uint32_t next_view_token_value_ = 1u; |
204 uint32_t next_view_tree_token_value_ = 1u; | 215 uint32_t next_view_tree_token_value_ = 1u; |
205 std::unordered_map<uint32_t, ViewState*> views_by_token_; | 216 std::unordered_map<uint32_t, ViewState*> views_by_token_; |
| 217 std::unordered_map<uint32_t, ViewState*> views_by_scene_token_; |
206 std::unordered_map<uint32_t, ViewTreeState*> view_trees_by_token_; | 218 std::unordered_map<uint32_t, ViewTreeState*> view_trees_by_token_; |
207 | 219 |
208 DISALLOW_COPY_AND_ASSIGN(ViewRegistry); | 220 DISALLOW_COPY_AND_ASSIGN(ViewRegistry); |
209 }; | 221 }; |
210 | 222 |
211 } // namespace view_manager | 223 } // namespace view_manager |
212 | 224 |
213 #endif // SERVICES_UI_VIEW_MANAGER_VIEW_REGISTRY_H_ | 225 #endif // SERVICES_UI_VIEW_MANAGER_VIEW_REGISTRY_H_ |
OLD | NEW |