OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_ | 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_ |
6 #define COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_ | 6 #define COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "components/mus/common/types.h" | 10 #include "components/mus/common/types.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 void Embed(Id window_id, | 79 void Embed(Id window_id, |
80 mojom::WindowTreeClientPtr client, | 80 mojom::WindowTreeClientPtr client, |
81 uint32_t policy_bitmask, | 81 uint32_t policy_bitmask, |
82 const mojom::WindowTree::EmbedCallback& callback); | 82 const mojom::WindowTree::EmbedCallback& callback); |
83 | 83 |
84 void AttachSurface(Id window_id, | 84 void AttachSurface(Id window_id, |
85 mojom::SurfaceType type, | 85 mojom::SurfaceType type, |
86 mojo::InterfaceRequest<mojom::Surface> surface, | 86 mojo::InterfaceRequest<mojom::Surface> surface, |
87 mojom::SurfaceClientPtr client); | 87 mojom::SurfaceClientPtr client); |
88 | 88 |
89 void set_change_acked_callback(const mojo::Callback<void(void)>& callback) { | |
90 change_acked_callback_ = callback; | |
91 } | |
92 void ClearChangeAckedCallback() { change_acked_callback_.reset(); } | |
93 | |
94 // Start/stop tracking windows. While tracked, they can be retrieved via | 89 // Start/stop tracking windows. While tracked, they can be retrieved via |
95 // WindowTreeConnection::GetWindowById. | 90 // WindowTreeConnection::GetWindowById. |
96 void AddWindow(Window* window); | 91 void AddWindow(Window* window); |
97 void RemoveWindow(Id window_id); | 92 void RemoveWindow(Id window_id); |
98 | 93 |
99 bool is_embed_root() const { return is_embed_root_; } | 94 bool is_embed_root() const { return is_embed_root_; } |
100 | 95 |
101 // Called after the root window's observers have been notified of destruction | 96 // Called after the root window's observers have been notified of destruction |
102 // (as the last step of ~Window). This ordering ensures that the Window Server | 97 // (as the last step of ~Window). This ordering ensures that the Window Server |
103 // is torn down after the root. | 98 // is torn down after the root. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 void OnWindowFocused(Id focused_window_id) override; | 171 void OnWindowFocused(Id focused_window_id) override; |
177 void OnChangeCompleted(uint32_t change_id, bool success) override; | 172 void OnChangeCompleted(uint32_t change_id, bool success) override; |
178 void WmSetBounds(uint32_t change_id, | 173 void WmSetBounds(uint32_t change_id, |
179 Id window_id, | 174 Id window_id, |
180 mojo::RectPtr transit_bounds) override; | 175 mojo::RectPtr transit_bounds) override; |
181 void WmSetProperty(uint32_t change_id, | 176 void WmSetProperty(uint32_t change_id, |
182 Id window_id, | 177 Id window_id, |
183 const mojo::String& name, | 178 const mojo::String& name, |
184 mojo::Array<uint8_t> transit_data) override; | 179 mojo::Array<uint8_t> transit_data) override; |
185 | 180 |
186 void OnActionCompleted(bool success); | |
187 | |
188 mojo::Callback<void(bool)> ActionCompletedCallback(); | 181 mojo::Callback<void(bool)> ActionCompletedCallback(); |
189 | 182 |
190 // This is set once and only once when we get OnEmbed(). It gives the unique | 183 // This is set once and only once when we get OnEmbed(). It gives the unique |
191 // id for this connection. | 184 // id for this connection. |
192 ConnectionSpecificId connection_id_; | 185 ConnectionSpecificId connection_id_; |
193 | 186 |
194 // Id assigned to the next window created. | 187 // Id assigned to the next window created. |
195 ConnectionSpecificId next_window_id_; | 188 ConnectionSpecificId next_window_id_; |
196 | 189 |
197 // Id used for the next change id supplied to the server. | 190 // Id used for the next change id supplied to the server. |
198 uint32_t next_change_id_; | 191 uint32_t next_change_id_; |
199 InFlightMap in_flight_map_; | 192 InFlightMap in_flight_map_; |
200 | 193 |
201 mojo::Callback<void(void)> change_acked_callback_; | |
202 | |
203 WindowTreeDelegate* delegate_; | 194 WindowTreeDelegate* delegate_; |
204 | 195 |
205 WindowManagerDelegate* window_manager_delegate_; | 196 WindowManagerDelegate* window_manager_delegate_; |
206 | 197 |
207 Window* root_; | 198 Window* root_; |
208 | 199 |
209 IdToWindowMap windows_; | 200 IdToWindowMap windows_; |
210 | 201 |
211 Window* focused_window_; | 202 Window* focused_window_; |
212 | 203 |
213 mojo::Binding<WindowTreeClient> binding_; | 204 mojo::Binding<WindowTreeClient> binding_; |
214 mojom::WindowTreePtr tree_ptr_; | 205 mojom::WindowTreePtr tree_ptr_; |
215 // Typically this is the value contained in |tree_ptr_|, but tests may | 206 // Typically this is the value contained in |tree_ptr_|, but tests may |
216 // directly set this. | 207 // directly set this. |
217 mojom::WindowTree* tree_; | 208 mojom::WindowTree* tree_; |
218 | 209 |
219 bool is_embed_root_; | 210 bool is_embed_root_; |
220 | 211 |
221 bool in_destructor_; | 212 bool in_destructor_; |
222 | 213 |
223 MOJO_DISALLOW_COPY_AND_ASSIGN(WindowTreeClientImpl); | 214 MOJO_DISALLOW_COPY_AND_ASSIGN(WindowTreeClientImpl); |
224 }; | 215 }; |
225 | 216 |
226 } // namespace mus | 217 } // namespace mus |
227 | 218 |
228 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_ | 219 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_ |
OLD | NEW |