| 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_MUS_APP_H_ | 5 #ifndef COMPONENTS_MUS_MUS_APP_H_ |
| 6 #define COMPONENTS_MUS_MUS_APP_H_ | 6 #define COMPONENTS_MUS_MUS_APP_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "components/mus/public/interfaces/display.mojom.h" | 15 #include "components/mus/public/interfaces/display.mojom.h" |
| 16 #include "components/mus/public/interfaces/gpu.mojom.h" | 16 #include "components/mus/public/interfaces/gpu.mojom.h" |
| 17 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" | 17 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" |
| 18 #include "components/mus/public/interfaces/window_tree.mojom.h" | 18 #include "components/mus/public/interfaces/window_tree.mojom.h" |
| 19 #include "components/mus/public/interfaces/window_tree_host.mojom.h" | 19 #include "components/mus/public/interfaces/window_tree_host.mojom.h" |
| 20 #include "components/mus/ws/connection_manager_delegate.h" | 20 #include "components/mus/ws/connection_manager_delegate.h" |
| 21 #include "mojo/public/cpp/bindings/binding_set.h" | 21 #include "mojo/public/cpp/bindings/binding_set.h" |
| 22 #include "mojo/services/tracing/public/cpp/tracing_impl.h" | 22 #include "mojo/services/tracing/public/cpp/tracing_impl.h" |
| 23 #include "mojo/shell/public/cpp/interface_factory.h" | 23 #include "mojo/shell/public/cpp/interface_factory.h" |
| 24 #include "mojo/shell/public/cpp/shell_client.h" | 24 #include "mojo/shell/public/cpp/shell_client.h" |
| 25 | 25 |
| 26 namespace mojo { | 26 namespace mojo { |
| 27 class Shell; | 27 class Connector; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace ui { | 30 namespace ui { |
| 31 class PlatformEventSource; | 31 class PlatformEventSource; |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace mus { | 34 namespace mus { |
| 35 | 35 |
| 36 class GpuState; | 36 class GpuState; |
| 37 class SurfacesState; | 37 class SurfacesState; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 53 public mojom::WindowTreeHostFactory { | 53 public mojom::WindowTreeHostFactory { |
| 54 public: | 54 public: |
| 55 MandolineUIServicesApp(); | 55 MandolineUIServicesApp(); |
| 56 ~MandolineUIServicesApp() override; | 56 ~MandolineUIServicesApp() override; |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 // Holds InterfaceRequests received before the first WindowTreeHost Display | 59 // Holds InterfaceRequests received before the first WindowTreeHost Display |
| 60 // has been established. | 60 // has been established. |
| 61 struct PendingRequest; | 61 struct PendingRequest; |
| 62 | 62 |
| 63 void InitializeResources(mojo::Shell* shell); | 63 void InitializeResources(mojo::Connector* connector); |
| 64 | 64 |
| 65 // mojo::ShellClient: | 65 // mojo::ShellClient: |
| 66 void Initialize(mojo::Shell* shell, const std::string& url, | 66 void Initialize(mojo::Connector* connector, const std::string& url, |
| 67 uint32_t id, uint32_t user_id) override; | 67 uint32_t id, uint32_t user_id) override; |
| 68 bool AcceptConnection(mojo::Connection* connection) override; | 68 bool AcceptConnection(mojo::Connection* connection) override; |
| 69 | 69 |
| 70 // ConnectionManagerDelegate: | 70 // ConnectionManagerDelegate: |
| 71 void OnFirstRootConnectionCreated() override; | 71 void OnFirstRootConnectionCreated() override; |
| 72 void OnNoMoreRootConnections() override; | 72 void OnNoMoreRootConnections() override; |
| 73 ws::ClientConnection* CreateClientConnectionForEmbedAtWindow( | 73 ws::ClientConnection* CreateClientConnectionForEmbedAtWindow( |
| 74 ws::ConnectionManager* connection_manager, | 74 ws::ConnectionManager* connection_manager, |
| 75 mojo::InterfaceRequest<mojom::WindowTree> tree_request, | 75 mojo::InterfaceRequest<mojom::WindowTree> tree_request, |
| 76 ws::ServerWindow* root, | 76 ws::ServerWindow* root, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 98 | 98 |
| 99 // mojo::InterfaceFactory<mojom::Gpu> implementation. | 99 // mojo::InterfaceFactory<mojom::Gpu> implementation. |
| 100 void Create(mojo::Connection* connection, | 100 void Create(mojo::Connection* connection, |
| 101 mojo::InterfaceRequest<mojom::Gpu> request) override; | 101 mojo::InterfaceRequest<mojom::Gpu> request) override; |
| 102 | 102 |
| 103 // mojom::WindowTreeHostFactory implementation. | 103 // mojom::WindowTreeHostFactory implementation. |
| 104 void CreateWindowTreeHost(mojo::InterfaceRequest<mojom::WindowTreeHost> host, | 104 void CreateWindowTreeHost(mojo::InterfaceRequest<mojom::WindowTreeHost> host, |
| 105 mojom::WindowTreeClientPtr tree_client) override; | 105 mojom::WindowTreeClientPtr tree_client) override; |
| 106 | 106 |
| 107 mojo::BindingSet<mojom::WindowTreeHostFactory> factory_bindings_; | 107 mojo::BindingSet<mojom::WindowTreeHostFactory> factory_bindings_; |
| 108 mojo::Shell* shell_; | 108 mojo::Connector* connector_; |
| 109 scoped_ptr<ws::ConnectionManager> connection_manager_; | 109 scoped_ptr<ws::ConnectionManager> connection_manager_; |
| 110 scoped_refptr<GpuState> gpu_state_; | 110 scoped_refptr<GpuState> gpu_state_; |
| 111 scoped_ptr<ui::PlatformEventSource> event_source_; | 111 scoped_ptr<ui::PlatformEventSource> event_source_; |
| 112 mojo::TracingImpl tracing_; | 112 mojo::TracingImpl tracing_; |
| 113 using PendingRequests = std::vector<scoped_ptr<PendingRequest>>; | 113 using PendingRequests = std::vector<scoped_ptr<PendingRequest>>; |
| 114 PendingRequests pending_requests_; | 114 PendingRequests pending_requests_; |
| 115 scoped_ptr<ws::WindowTreeFactory> window_tree_factory_; | 115 scoped_ptr<ws::WindowTreeFactory> window_tree_factory_; |
| 116 | 116 |
| 117 // Surfaces | 117 // Surfaces |
| 118 scoped_refptr<SurfacesState> surfaces_state_; | 118 scoped_refptr<SurfacesState> surfaces_state_; |
| 119 | 119 |
| 120 DISALLOW_COPY_AND_ASSIGN(MandolineUIServicesApp); | 120 DISALLOW_COPY_AND_ASSIGN(MandolineUIServicesApp); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace mus | 123 } // namespace mus |
| 124 | 124 |
| 125 #endif // COMPONENTS_MUS_MUS_APP_H_ | 125 #endif // COMPONENTS_MUS_MUS_APP_H_ |
| OLD | NEW |