| 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_BINDING_H_ | 5 #ifndef COMPONENTS_MUS_WS_WINDOW_TREE_BINDING_H_ |
| 6 #define COMPONENTS_MUS_WS_WINDOW_TREE_BINDING_H_ | 6 #define COMPONENTS_MUS_WS_WINDOW_TREE_BINDING_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "components/mus/public/interfaces/window_tree.mojom.h" | 11 #include "components/mus/public/interfaces/window_tree.mojom.h" |
| 12 #include "mojo/public/cpp/bindings/binding.h" | 12 #include "mojo/public/cpp/bindings/binding.h" |
| 13 | 13 |
| 14 namespace mus { | 14 namespace mus { |
| 15 namespace ws { | 15 namespace ws { |
| 16 | 16 |
| 17 class WindowServer; | 17 class WindowServer; |
| 18 class WindowTree; | 18 class WindowTree; |
| 19 | 19 |
| 20 // WindowTreeBinding manages the binding between a WindowTree and its mojo | 20 // WindowTreeBinding manages the binding between a WindowTree and its |
| 21 // clients. WindowTreeBinding exists so that the client can be mocked for | 21 // WindowTreeClient. WindowTreeBinding exists so that a mock implementation |
| 22 // tests. WindowTree owns its associated WindowTreeBinding. | 22 // of WindowTreeClient can be injected for tests. WindowTree owns its |
| 23 // associated WindowTreeBinding. |
| 23 class WindowTreeBinding { | 24 class WindowTreeBinding { |
| 24 public: | 25 public: |
| 25 explicit WindowTreeBinding(mojom::WindowTreeClient* client); | 26 explicit WindowTreeBinding(mojom::WindowTreeClient* client); |
| 26 virtual ~WindowTreeBinding(); | 27 virtual ~WindowTreeBinding(); |
| 27 | 28 |
| 28 mojom::WindowTreeClient* client() { return client_; } | 29 mojom::WindowTreeClient* client() { return client_; } |
| 29 | 30 |
| 30 // Obtains a new WindowManager. This should only be called once. | 31 // Obtains a new WindowManager. This should only be called once. |
| 31 virtual mojom::WindowManager* GetWindowManager() = 0; | 32 virtual mojom::WindowManager* GetWindowManager() = 0; |
| 32 | 33 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 62 mojom::WindowTreeClientPtr client_; | 63 mojom::WindowTreeClientPtr client_; |
| 63 mojom::WindowManagerAssociatedPtr window_manager_internal_; | 64 mojom::WindowManagerAssociatedPtr window_manager_internal_; |
| 64 | 65 |
| 65 DISALLOW_COPY_AND_ASSIGN(DefaultWindowTreeBinding); | 66 DISALLOW_COPY_AND_ASSIGN(DefaultWindowTreeBinding); |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 } // namespace ws | 69 } // namespace ws |
| 69 } // namespace mus | 70 } // namespace mus |
| 70 | 71 |
| 71 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_BINDING_H_ | 72 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_BINDING_H_ |
| OLD | NEW |