| 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 SERVICES_UI_WS_WINDOW_TREE_BINDING_H_ | 5 #ifndef SERVICES_UI_WS_WINDOW_TREE_BINDING_H_ |
| 6 #define SERVICES_UI_WS_WINDOW_TREE_BINDING_H_ | 6 #define SERVICES_UI_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" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 explicit WindowTreeBinding(mojom::WindowTreeClient* client); | 26 explicit WindowTreeBinding(mojom::WindowTreeClient* client); |
| 27 virtual ~WindowTreeBinding(); | 27 virtual ~WindowTreeBinding(); |
| 28 | 28 |
| 29 mojom::WindowTreeClient* client() { return client_; } | 29 mojom::WindowTreeClient* client() { return client_; } |
| 30 | 30 |
| 31 // Obtains a new WindowManager. This should only be called once. | 31 // Obtains a new WindowManager. This should only be called once. |
| 32 virtual mojom::WindowManager* GetWindowManager() = 0; | 32 virtual mojom::WindowManager* GetWindowManager() = 0; |
| 33 | 33 |
| 34 virtual void SetIncomingMethodCallProcessingPaused(bool paused) = 0; | 34 virtual void SetIncomingMethodCallProcessingPaused(bool paused) = 0; |
| 35 | 35 |
| 36 // Called when the WindowServer is destroyed. Sets |client_| to |
| 37 // CreateClientForShutdown(). |
| 38 void ResetClientForShutdown(); |
| 39 |
| 40 protected: |
| 41 virtual mojom::WindowTreeClient* CreateClientForShutdown() = 0; |
| 42 |
| 36 private: | 43 private: |
| 37 mojom::WindowTreeClient* client_; | 44 mojom::WindowTreeClient* client_; |
| 38 | 45 |
| 39 DISALLOW_COPY_AND_ASSIGN(WindowTreeBinding); | 46 DISALLOW_COPY_AND_ASSIGN(WindowTreeBinding); |
| 40 }; | 47 }; |
| 41 | 48 |
| 42 // Bindings implementation of WindowTreeBinding. | 49 // Bindings implementation of WindowTreeBinding. |
| 43 class DefaultWindowTreeBinding : public WindowTreeBinding { | 50 class DefaultWindowTreeBinding : public WindowTreeBinding { |
| 44 public: | 51 public: |
| 45 DefaultWindowTreeBinding(WindowTree* tree, | 52 DefaultWindowTreeBinding(WindowTree* tree, |
| 46 WindowServer* window_server, | 53 WindowServer* window_server, |
| 47 mojom::WindowTreeRequest service_request, | 54 mojom::WindowTreeRequest service_request, |
| 48 mojom::WindowTreeClientPtr client); | 55 mojom::WindowTreeClientPtr client); |
| 49 DefaultWindowTreeBinding(WindowTree* tree, | 56 DefaultWindowTreeBinding(WindowTree* tree, |
| 50 mojom::WindowTreeClientPtr client); | 57 mojom::WindowTreeClientPtr client); |
| 51 ~DefaultWindowTreeBinding() override; | 58 ~DefaultWindowTreeBinding() override; |
| 52 | 59 |
| 53 // Use when created with the constructor that does not take a | 60 // Use when created with the constructor that does not take a |
| 54 // WindowTreeRequest. | 61 // WindowTreeRequest. |
| 55 mojom::WindowTreePtr CreateInterfacePtrAndBind(); | 62 mojom::WindowTreePtr CreateInterfacePtrAndBind(); |
| 56 | 63 |
| 57 // WindowTreeBinding: | 64 // WindowTreeBinding: |
| 58 mojom::WindowManager* GetWindowManager() override; | 65 mojom::WindowManager* GetWindowManager() override; |
| 59 void SetIncomingMethodCallProcessingPaused(bool paused) override; | 66 void SetIncomingMethodCallProcessingPaused(bool paused) override; |
| 60 | 67 |
| 68 protected: |
| 69 // WindowTreeBinding: |
| 70 mojom::WindowTreeClient* CreateClientForShutdown() override; |
| 71 |
| 61 private: | 72 private: |
| 62 mojo::Binding<mojom::WindowTree> binding_; | 73 mojo::Binding<mojom::WindowTree> binding_; |
| 63 mojom::WindowTreeClientPtr client_; | 74 mojom::WindowTreeClientPtr client_; |
| 64 mojom::WindowManagerAssociatedPtr window_manager_internal_; | 75 mojom::WindowManagerAssociatedPtr window_manager_internal_; |
| 65 | 76 |
| 66 DISALLOW_COPY_AND_ASSIGN(DefaultWindowTreeBinding); | 77 DISALLOW_COPY_AND_ASSIGN(DefaultWindowTreeBinding); |
| 67 }; | 78 }; |
| 68 | 79 |
| 69 } // namespace ws | 80 } // namespace ws |
| 70 } // namespace ui | 81 } // namespace ui |
| 71 | 82 |
| 72 #endif // SERVICES_UI_WS_WINDOW_TREE_BINDING_H_ | 83 #endif // SERVICES_UI_WS_WINDOW_TREE_BINDING_H_ |
| OLD | NEW |