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 "base/observer_list.h" |
10 #include "components/mus/common/types.h" | 11 #include "components/mus/common/types.h" |
11 #include "components/mus/public/cpp/window.h" | 12 #include "components/mus/public/cpp/window.h" |
12 #include "components/mus/public/cpp/window_tree_connection.h" | 13 #include "components/mus/public/cpp/window_tree_connection.h" |
13 #include "components/mus/public/interfaces/window_tree.mojom.h" | 14 #include "components/mus/public/interfaces/window_tree.mojom.h" |
14 #include "mojo/public/cpp/bindings/strong_binding.h" | 15 #include "mojo/public/cpp/bindings/strong_binding.h" |
15 | 16 |
16 namespace gfx { | 17 namespace gfx { |
17 class Insets; | 18 class Insets; |
18 class Size; | 19 class Size; |
19 } | 20 } |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 Id focused_window_id, | 123 Id focused_window_id, |
123 uint32 access_policy); | 124 uint32 access_policy); |
124 | 125 |
125 // Overridden from WindowTreeConnection: | 126 // Overridden from WindowTreeConnection: |
126 Window* GetRoot() override; | 127 Window* GetRoot() override; |
127 Window* GetWindowById(Id id) override; | 128 Window* GetWindowById(Id id) override; |
128 Window* GetFocusedWindow() override; | 129 Window* GetFocusedWindow() override; |
129 Window* NewWindow(const Window::SharedProperties* properties) override; | 130 Window* NewWindow(const Window::SharedProperties* properties) override; |
130 bool IsEmbedRoot() override; | 131 bool IsEmbedRoot() override; |
131 ConnectionSpecificId GetConnectionId() override; | 132 ConnectionSpecificId GetConnectionId() override; |
| 133 void AddObserver(WindowTreeConnectionObserver* observer) override; |
| 134 void RemoveObserver(WindowTreeConnectionObserver* observer) override; |
132 | 135 |
133 // Overridden from WindowTreeClient: | 136 // Overridden from WindowTreeClient: |
134 void OnEmbed(ConnectionSpecificId connection_id, | 137 void OnEmbed(ConnectionSpecificId connection_id, |
135 mojom::WindowDataPtr root, | 138 mojom::WindowDataPtr root, |
136 mojom::WindowTreePtr tree, | 139 mojom::WindowTreePtr tree, |
137 Id focused_window_id, | 140 Id focused_window_id, |
138 uint32_t access_policy) override; | 141 uint32_t access_policy) override; |
139 void OnEmbeddedAppDisconnected(Id window_id) override; | 142 void OnEmbeddedAppDisconnected(Id window_id) override; |
140 void OnUnembed() override; | 143 void OnUnembed() override; |
141 void OnWindowBoundsChanged(Id window_id, | 144 void OnWindowBoundsChanged(Id window_id, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 mojo::Binding<WindowTreeClient> binding_; | 207 mojo::Binding<WindowTreeClient> binding_; |
205 mojom::WindowTreePtr tree_ptr_; | 208 mojom::WindowTreePtr tree_ptr_; |
206 // Typically this is the value contained in |tree_ptr_|, but tests may | 209 // Typically this is the value contained in |tree_ptr_|, but tests may |
207 // directly set this. | 210 // directly set this. |
208 mojom::WindowTree* tree_; | 211 mojom::WindowTree* tree_; |
209 | 212 |
210 bool is_embed_root_; | 213 bool is_embed_root_; |
211 | 214 |
212 bool in_destructor_; | 215 bool in_destructor_; |
213 | 216 |
| 217 base::ObserverList<WindowTreeConnectionObserver> observers_; |
| 218 |
214 MOJO_DISALLOW_COPY_AND_ASSIGN(WindowTreeClientImpl); | 219 MOJO_DISALLOW_COPY_AND_ASSIGN(WindowTreeClientImpl); |
215 }; | 220 }; |
216 | 221 |
217 } // namespace mus | 222 } // namespace mus |
218 | 223 |
219 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_ | 224 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_ |
OLD | NEW |