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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <set> | 11 #include <set> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
15 #include "components/mus/common/types.h" | 15 #include "components/mus/common/types.h" |
16 #include "components/mus/public/cpp/window.h" | 16 #include "components/mus/public/cpp/window.h" |
| 17 #include "components/mus/public/cpp/window_manager_delegate.h" |
17 #include "components/mus/public/cpp/window_tree_connection.h" | 18 #include "components/mus/public/cpp/window_tree_connection.h" |
18 #include "components/mus/public/interfaces/window_tree.mojom.h" | 19 #include "components/mus/public/interfaces/window_tree.mojom.h" |
19 #include "mojo/public/cpp/bindings/associated_binding.h" | 20 #include "mojo/public/cpp/bindings/associated_binding.h" |
20 #include "mojo/public/cpp/bindings/strong_binding.h" | 21 #include "mojo/public/cpp/bindings/strong_binding.h" |
21 | 22 |
22 namespace gfx { | 23 namespace gfx { |
23 class Insets; | 24 class Insets; |
24 class Size; | 25 class Size; |
25 } | 26 } |
26 | 27 |
27 namespace mus { | 28 namespace mus { |
28 class InFlightChange; | 29 class InFlightChange; |
29 class WindowTreeClientImplPrivate; | 30 class WindowTreeClientImplPrivate; |
30 class WindowTreeConnection; | 31 class WindowTreeConnection; |
31 class WindowTreeDelegate; | 32 class WindowTreeDelegate; |
32 | 33 |
33 enum class ChangeType; | 34 enum class ChangeType; |
34 | 35 |
35 // Manages the connection with the Window Server service. | 36 // Manages the connection with the Window Server service. |
36 class WindowTreeClientImpl : public WindowTreeConnection, | 37 class WindowTreeClientImpl : public WindowTreeConnection, |
37 public mojom::WindowTreeClient, | 38 public mojom::WindowTreeClient, |
38 public mojom::WindowManagerInternal { | 39 public mojom::WindowManagerInternal, |
| 40 public WindowManagerClient { |
39 public: | 41 public: |
40 WindowTreeClientImpl(WindowTreeDelegate* delegate, | 42 WindowTreeClientImpl(WindowTreeDelegate* delegate, |
41 WindowManagerDelegate* window_manager_delegate, | 43 WindowManagerDelegate* window_manager_delegate, |
42 mojo::InterfaceRequest<mojom::WindowTreeClient> request); | 44 mojo::InterfaceRequest<mojom::WindowTreeClient> request); |
43 ~WindowTreeClientImpl() override; | 45 ~WindowTreeClientImpl() override; |
44 | 46 |
45 // Wait for OnEmbed(), returning when done. | 47 // Wait for OnEmbed(), returning when done. |
46 void WaitForEmbed(); | 48 void WaitForEmbed(); |
47 | 49 |
48 bool connected() const { return tree_ != nullptr; } | 50 bool connected() const { return tree_ != nullptr; } |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 Id window_id, | 219 Id window_id, |
218 mojo::RectPtr transit_bounds) override; | 220 mojo::RectPtr transit_bounds) override; |
219 void WmSetProperty(uint32_t change_id, | 221 void WmSetProperty(uint32_t change_id, |
220 Id window_id, | 222 Id window_id, |
221 const mojo::String& name, | 223 const mojo::String& name, |
222 mojo::Array<uint8_t> transit_data) override; | 224 mojo::Array<uint8_t> transit_data) override; |
223 void WmCreateTopLevelWindow(uint32_t change_id, | 225 void WmCreateTopLevelWindow(uint32_t change_id, |
224 mojo::Map<mojo::String, mojo::Array<uint8_t>> | 226 mojo::Map<mojo::String, mojo::Array<uint8_t>> |
225 transport_properties) override; | 227 transport_properties) override; |
226 | 228 |
| 229 // Overriden from WindowManagerClient: |
| 230 void SetFrameDecorationValues( |
| 231 mojom::FrameDecorationValuesPtr values) override; |
| 232 |
227 // This is set once and only once when we get OnEmbed(). It gives the unique | 233 // This is set once and only once when we get OnEmbed(). It gives the unique |
228 // id for this connection. | 234 // id for this connection. |
229 ConnectionSpecificId connection_id_; | 235 ConnectionSpecificId connection_id_; |
230 | 236 |
231 // Id assigned to the next window created. | 237 // Id assigned to the next window created. |
232 ConnectionSpecificId next_window_id_; | 238 ConnectionSpecificId next_window_id_; |
233 | 239 |
234 // Id used for the next change id supplied to the server. | 240 // Id used for the next change id supplied to the server. |
235 uint32_t next_change_id_; | 241 uint32_t next_change_id_; |
236 InFlightMap in_flight_map_; | 242 InFlightMap in_flight_map_; |
(...skipping 26 matching lines...) Expand all Loading... |
263 window_manager_internal_; | 269 window_manager_internal_; |
264 mojom::WindowManagerInternalClientAssociatedPtr | 270 mojom::WindowManagerInternalClientAssociatedPtr |
265 window_manager_internal_client_; | 271 window_manager_internal_client_; |
266 | 272 |
267 MOJO_DISALLOW_COPY_AND_ASSIGN(WindowTreeClientImpl); | 273 MOJO_DISALLOW_COPY_AND_ASSIGN(WindowTreeClientImpl); |
268 }; | 274 }; |
269 | 275 |
270 } // namespace mus | 276 } // namespace mus |
271 | 277 |
272 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_ | 278 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_ |
OLD | NEW |