| 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_CONNECTION_MANAGER_DELEGATE_H_ | 5 #ifndef COMPONENTS_MUS_WS_CONNECTION_MANAGER_DELEGATE_H_ |
| 6 #define COMPONENTS_MUS_WS_CONNECTION_MANAGER_DELEGATE_H_ | 6 #define COMPONENTS_MUS_WS_CONNECTION_MANAGER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "components/mus/common/types.h" | 12 #include "components/mus/common/types.h" |
| 13 #include "components/mus/public/interfaces/window_tree.mojom.h" | 13 #include "components/mus/public/interfaces/window_tree.mojom.h" |
| 14 #include "mojo/public/cpp/bindings/interface_request.h" | 14 #include "mojo/public/cpp/bindings/interface_request.h" |
| 15 | 15 |
| 16 namespace mus { | 16 namespace mus { |
| 17 | 17 |
| 18 namespace mojom { |
| 19 class Display; |
| 20 class WindowManagerFactory; |
| 21 class WindowTree; |
| 22 } |
| 23 |
| 18 namespace ws { | 24 namespace ws { |
| 19 | 25 |
| 20 class ClientConnection; | 26 class ClientConnection; |
| 21 class ConnectionManager; | 27 class ConnectionManager; |
| 22 class ServerWindow; | 28 class ServerWindow; |
| 29 class WindowTreeHostImpl; |
| 23 | 30 |
| 24 class ConnectionManagerDelegate { | 31 class ConnectionManagerDelegate { |
| 25 public: | 32 public: |
| 26 virtual void OnFirstRootConnectionCreated(); | 33 virtual void OnFirstRootConnectionCreated(); |
| 27 | 34 |
| 28 virtual void OnNoMoreRootConnections() = 0; | 35 virtual void OnNoMoreRootConnections() = 0; |
| 29 | 36 |
| 30 // Creates a ClientConnection in response to Embed() calls on the | 37 // Creates a ClientConnection in response to Embed() calls on the |
| 31 // ConnectionManager. | 38 // ConnectionManager. |
| 32 virtual ClientConnection* CreateClientConnectionForEmbedAtWindow( | 39 virtual ClientConnection* CreateClientConnectionForEmbedAtWindow( |
| 33 ConnectionManager* connection_manager, | 40 ConnectionManager* connection_manager, |
| 34 mojo::InterfaceRequest<mojom::WindowTree> tree_request, | 41 mojom::WindowTreeRequest tree_request, |
| 35 ServerWindow* root, | 42 ServerWindow* root, |
| 36 uint32_t policy_bitmask, | 43 uint32_t policy_bitmask, |
| 37 mojom::WindowTreeClientPtr client) = 0; | 44 mojom::WindowTreeClientPtr client) = 0; |
| 38 | 45 |
| 46 virtual ClientConnection* CreateClientConnectionForWindowManager( |
| 47 WindowTreeHostImpl* tree_host, |
| 48 ServerWindow* window, |
| 49 const mojom::Display& display, |
| 50 uint32_t user_id, |
| 51 mojom::WindowManagerFactory* factory) = 0; |
| 52 |
| 53 // Called if no WindowTreeHosts have been created, but a |
| 54 // WindowManagerFactory has been set. |
| 55 virtual void CreateDefaultWindowTreeHosts() = 0; |
| 56 |
| 39 protected: | 57 protected: |
| 40 virtual ~ConnectionManagerDelegate() {} | 58 virtual ~ConnectionManagerDelegate() {} |
| 41 }; | 59 }; |
| 42 | 60 |
| 43 } // namespace ws | 61 } // namespace ws |
| 44 | |
| 45 } // namespace mus | 62 } // namespace mus |
| 46 | 63 |
| 47 #endif // COMPONENTS_MUS_WS_CONNECTION_MANAGER_DELEGATE_H_ | 64 #endif // COMPONENTS_MUS_WS_CONNECTION_MANAGER_DELEGATE_H_ |
| OLD | NEW |