| 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_WS_WINDOW_TREE_IMPL_H_ | 5 #ifndef COMPONENTS_MUS_WS_WINDOW_TREE_IMPL_H_ |
| 6 #define COMPONENTS_MUS_WS_WINDOW_TREE_IMPL_H_ | 6 #define COMPONENTS_MUS_WS_WINDOW_TREE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 // An instance of WindowTreeImpl is created for every WindowTree request. | 39 // An instance of WindowTreeImpl is created for every WindowTree request. |
| 40 // WindowTreeImpl tracks all the state and windows created by a client. | 40 // WindowTreeImpl tracks all the state and windows created by a client. |
| 41 // WindowTreeImpl coordinates with ConnectionManager to update the client (and | 41 // WindowTreeImpl coordinates with ConnectionManager to update the client (and |
| 42 // internal state) as necessary. | 42 // internal state) as necessary. |
| 43 class WindowTreeImpl : public mojom::WindowTree, | 43 class WindowTreeImpl : public mojom::WindowTree, |
| 44 public AccessPolicyDelegate, | 44 public AccessPolicyDelegate, |
| 45 public mojom::WindowManagerInternalClient { | 45 public mojom::WindowManagerInternalClient { |
| 46 public: | 46 public: |
| 47 WindowTreeImpl(ConnectionManager* connection_manager, | 47 WindowTreeImpl(ConnectionManager* connection_manager, |
| 48 ConnectionSpecificId creator_id, | |
| 49 const WindowId& root_id, | 48 const WindowId& root_id, |
| 50 uint32_t policy_bitmask); | 49 uint32_t policy_bitmask); |
| 51 ~WindowTreeImpl() override; | 50 ~WindowTreeImpl() override; |
| 52 | 51 |
| 53 void Init(mojom::WindowTreeClient* client, mojom::WindowTreePtr tree); | 52 void Init(mojom::WindowTreeClient* client, mojom::WindowTreePtr tree); |
| 54 | 53 |
| 55 ConnectionSpecificId id() const { return id_; } | 54 ConnectionSpecificId id() const { return id_; } |
| 56 ConnectionSpecificId creator_id() const { return creator_id_; } | |
| 57 | 55 |
| 58 mojom::WindowTreeClient* client() { return client_; } | 56 mojom::WindowTreeClient* client() { return client_; } |
| 59 | 57 |
| 60 // Returns the Window with the specified id. | 58 // Returns the Window with the specified id. |
| 61 ServerWindow* GetWindow(const WindowId& id) { | 59 ServerWindow* GetWindow(const WindowId& id) { |
| 62 return const_cast<ServerWindow*>( | 60 return const_cast<ServerWindow*>( |
| 63 const_cast<const WindowTreeImpl*>(this)->GetWindow(id)); | 61 const_cast<const WindowTreeImpl*>(this)->GetWindow(id)); |
| 64 } | 62 } |
| 65 const ServerWindow* GetWindow(const WindowId& id) const; | 63 const ServerWindow* GetWindow(const WindowId& id) const; |
| 66 | 64 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 bool IsWindowKnownForAccessPolicy(const ServerWindow* window) const override; | 268 bool IsWindowKnownForAccessPolicy(const ServerWindow* window) const override; |
| 271 bool IsWindowRootOfAnotherConnectionForAccessPolicy( | 269 bool IsWindowRootOfAnotherConnectionForAccessPolicy( |
| 272 const ServerWindow* window) const override; | 270 const ServerWindow* window) const override; |
| 273 bool IsDescendantOfEmbedRoot(const ServerWindow* window) override; | 271 bool IsDescendantOfEmbedRoot(const ServerWindow* window) override; |
| 274 | 272 |
| 275 ConnectionManager* connection_manager_; | 273 ConnectionManager* connection_manager_; |
| 276 | 274 |
| 277 // Id of this connection as assigned by ConnectionManager. | 275 // Id of this connection as assigned by ConnectionManager. |
| 278 const ConnectionSpecificId id_; | 276 const ConnectionSpecificId id_; |
| 279 | 277 |
| 280 // ID of the connection that created us. If 0 it indicates either we were | |
| 281 // created by the root, or the connection that created us has been destroyed. | |
| 282 ConnectionSpecificId creator_id_; | |
| 283 | |
| 284 mojom::WindowTreeClient* client_; | 278 mojom::WindowTreeClient* client_; |
| 285 | 279 |
| 286 scoped_ptr<mus::ws::AccessPolicy> access_policy_; | 280 scoped_ptr<mus::ws::AccessPolicy> access_policy_; |
| 287 | 281 |
| 288 // The windows created by this connection. This connection owns these objects. | 282 // The windows created by this connection. This connection owns these objects. |
| 289 WindowMap window_map_; | 283 WindowMap window_map_; |
| 290 | 284 |
| 291 // The set of windows that has been communicated to the client. | 285 // The set of windows that has been communicated to the client. |
| 292 WindowIdSet known_windows_; | 286 WindowIdSet known_windows_; |
| 293 | 287 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 306 mojom::WindowManagerInternal* window_manager_internal_; | 300 mojom::WindowManagerInternal* window_manager_internal_; |
| 307 | 301 |
| 308 DISALLOW_COPY_AND_ASSIGN(WindowTreeImpl); | 302 DISALLOW_COPY_AND_ASSIGN(WindowTreeImpl); |
| 309 }; | 303 }; |
| 310 | 304 |
| 311 } // namespace ws | 305 } // namespace ws |
| 312 | 306 |
| 313 } // namespace mus | 307 } // namespace mus |
| 314 | 308 |
| 315 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_IMPL_H_ | 309 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_IMPL_H_ |
| OLD | NEW |