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_VIEW_TREE_CLIENT_IMPL_H_ | 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_LIB_VIEW_TREE_CLIENT_IMPL_H_ |
6 #define COMPONENTS_MUS_PUBLIC_CPP_LIB_VIEW_TREE_CLIENT_IMPL_H_ | 6 #define COMPONENTS_MUS_PUBLIC_CPP_LIB_VIEW_TREE_CLIENT_IMPL_H_ |
7 | 7 |
8 #include "components/mus/public/cpp/types.h" | 8 #include "components/mus/public/cpp/types.h" |
9 #include "components/mus/public/cpp/view.h" | 9 #include "components/mus/public/cpp/view.h" |
10 #include "components/mus/public/cpp/view_tree_connection.h" | 10 #include "components/mus/public/cpp/view_tree_connection.h" |
11 #include "components/mus/public/interfaces/view_tree.mojom.h" | 11 #include "components/mus/public/interfaces/view_tree.mojom.h" |
12 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" | 12 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" |
13 | 13 |
14 namespace mus { | 14 namespace mus { |
15 class ViewTreeConnection; | 15 class ViewTreeConnection; |
16 class ViewTreeDelegate; | 16 class ViewTreeDelegate; |
17 | 17 |
18 // Manages the connection with the View Manager service. | 18 // Manages the connection with the View Manager service. |
19 class ViewTreeClientImpl : public ViewTreeConnection, | 19 class ViewTreeClientImpl : public ViewTreeConnection, |
20 public mojo::ViewTreeClient { | 20 public mojo::ViewTreeClient { |
21 public: | 21 public: |
22 ViewTreeClientImpl(ViewTreeDelegate* delegate, | 22 ViewTreeClientImpl(ViewTreeDelegate* delegate, |
23 mojo::InterfaceRequest<mojo::ViewTreeClient> request); | 23 mojo::InterfaceRequest<mojo::ViewTreeClient> request); |
24 ~ViewTreeClientImpl() override; | 24 ~ViewTreeClientImpl() override; |
25 | 25 |
| 26 // Wait for OnEmbed(), returning when done. |
| 27 void WaitForEmbed(); |
| 28 |
26 bool connected() const { return tree_; } | 29 bool connected() const { return tree_; } |
27 ConnectionSpecificId connection_id() const { return connection_id_; } | 30 ConnectionSpecificId connection_id() const { return connection_id_; } |
28 | 31 |
29 // API exposed to the view implementations that pushes local changes to the | 32 // API exposed to the view implementations that pushes local changes to the |
30 // service. | 33 // service. |
31 void DestroyView(Id view_id); | 34 void DestroyView(Id view_id); |
32 | 35 |
33 // These methods take TransportIds. For views owned by the current connection, | 36 // These methods take TransportIds. For views owned by the current connection, |
34 // the connection id high word can be zero. In all cases, the TransportId 0x1 | 37 // the connection id high word can be zero. In all cases, the TransportId 0x1 |
35 // refers to the root view. | 38 // refers to the root view. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 bool is_embed_root_; | 153 bool is_embed_root_; |
151 | 154 |
152 bool in_destructor_; | 155 bool in_destructor_; |
153 | 156 |
154 MOJO_DISALLOW_COPY_AND_ASSIGN(ViewTreeClientImpl); | 157 MOJO_DISALLOW_COPY_AND_ASSIGN(ViewTreeClientImpl); |
155 }; | 158 }; |
156 | 159 |
157 } // namespace mus | 160 } // namespace mus |
158 | 161 |
159 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_VIEW_TREE_CLIENT_IMPL_H_ | 162 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_VIEW_TREE_CLIENT_IMPL_H_ |
OLD | NEW |