| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_VIEW_TREE_HOST_CONNECTION_H_ | 5 #ifndef COMPONENTS_MUS_WS_VIEW_TREE_HOST_CONNECTION_H_ |
| 6 #define COMPONENTS_MUS_WS_VIEW_TREE_HOST_CONNECTION_H_ | 6 #define COMPONENTS_MUS_WS_VIEW_TREE_HOST_CONNECTION_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "components/mus/public/interfaces/view_tree_host.mojom.h" | 9 #include "components/mus/public/interfaces/window_tree_host.mojom.h" |
| 10 #include "components/mus/ws/view_tree_host_delegate.h" | 10 #include "components/mus/ws/view_tree_host_delegate.h" |
| 11 #include "components/mus/ws/view_tree_host_impl.h" | 11 #include "components/mus/ws/view_tree_host_impl.h" |
| 12 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" | 12 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" |
| 13 | 13 |
| 14 namespace mus { | 14 namespace mus { |
| 15 | 15 |
| 16 class ConnectionManager; | 16 class ConnectionManager; |
| 17 class ViewTreeImpl; | 17 class ViewTreeImpl; |
| 18 | 18 |
| 19 // ViewTreeHostConnection is a server-side object that encapsulates the | 19 // ViewTreeHostConnection is a server-side object that encapsulates the |
| (...skipping 19 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 | 40 |
| 41 void CloseConnection(); | 41 void CloseConnection(); |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 ~ViewTreeHostConnection() override; | 44 ~ViewTreeHostConnection() override; |
| 45 | 45 |
| 46 // ViewTreeHostDelegate: | 46 // ViewTreeHostDelegate: |
| 47 void OnDisplayInitialized() override; | 47 void OnDisplayInitialized() override; |
| 48 void OnDisplayClosed() override; | 48 void OnDisplayClosed() override; |
| 49 ViewTreeImpl* GetViewTree() override; | 49 ViewTreeImpl* GetWindowTree() override; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 scoped_ptr<ViewTreeHostImpl> host_; | 52 scoped_ptr<ViewTreeHostImpl> host_; |
| 53 ViewTreeImpl* tree_; | 53 ViewTreeImpl* tree_; |
| 54 ConnectionManager* connection_manager_; | 54 ConnectionManager* connection_manager_; |
| 55 bool connection_closed_; | 55 bool connection_closed_; |
| 56 | 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(ViewTreeHostConnection); | 57 DISALLOW_COPY_AND_ASSIGN(ViewTreeHostConnection); |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 // Live implementation of ViewTreeHostConnection. | 60 // Live implementation of ViewTreeHostConnection. |
| 61 class ViewTreeHostConnectionImpl : public ViewTreeHostConnection { | 61 class ViewTreeHostConnectionImpl : public ViewTreeHostConnection { |
| 62 public: | 62 public: |
| 63 ViewTreeHostConnectionImpl(mojo::InterfaceRequest<mojo::ViewTreeHost> request, | 63 ViewTreeHostConnectionImpl( |
| 64 scoped_ptr<ViewTreeHostImpl> host_impl, | 64 mojo::InterfaceRequest<mojom::WindowTreeHost> request, |
| 65 mojo::ViewTreeClientPtr client, | 65 scoped_ptr<ViewTreeHostImpl> host_impl, |
| 66 ConnectionManager* connection_manager); | 66 mojom::WindowTreeClientPtr client, |
| 67 ConnectionManager* connection_manager); |
| 67 | 68 |
| 68 private: | 69 private: |
| 69 ~ViewTreeHostConnectionImpl() override; | 70 ~ViewTreeHostConnectionImpl() override; |
| 70 | 71 |
| 71 // ViewTreeHostDelegate: | 72 // ViewTreeHostDelegate: |
| 72 void OnDisplayInitialized() override; | 73 void OnDisplayInitialized() override; |
| 73 | 74 |
| 74 mojo::Binding<mojo::ViewTreeHost> binding_; | 75 mojo::Binding<mojom::WindowTreeHost> binding_; |
| 75 mojo::ViewTreeClientPtr client_; | 76 mojom::WindowTreeClientPtr client_; |
| 76 | 77 |
| 77 DISALLOW_COPY_AND_ASSIGN(ViewTreeHostConnectionImpl); | 78 DISALLOW_COPY_AND_ASSIGN(ViewTreeHostConnectionImpl); |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 } // namespace mus | 81 } // namespace mus |
| 81 | 82 |
| 82 #endif // COMPONENTS_MUS_WS_VIEW_TREE_HOST_CONNECTION_H_ | 83 #endif // COMPONENTS_MUS_WS_VIEW_TREE_HOST_CONNECTION_H_ |
| OLD | NEW |