| 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 <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "components/mus/public/interfaces/display.mojom.h" | 14 #include "components/mus/public/interfaces/display.mojom.h" |
| 15 #include "components/mus/public/interfaces/gpu.mojom.h" | 15 #include "components/mus/public/interfaces/gpu.mojom.h" |
| 16 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" | 16 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" |
| 17 #include "components/mus/public/interfaces/window_tree.mojom.h" | 17 #include "components/mus/public/interfaces/window_tree.mojom.h" |
| 18 #include "components/mus/public/interfaces/window_tree_host.mojom.h" | 18 #include "components/mus/public/interfaces/window_tree_host.mojom.h" |
| 19 #include "components/mus/ws/connection_manager_delegate.h" | 19 #include "components/mus/ws/connection_manager_delegate.h" |
| 20 #include "mojo/common/weak_binding_set.h" | 20 #include "mojo/common/weak_binding_set.h" |
| 21 #include "mojo/services/tracing/public/cpp/tracing_impl.h" | 21 #include "mojo/services/tracing/public/cpp/tracing_impl.h" |
| 22 #include "mojo/shell/public/cpp/app_lifetime_helper.h" | 22 #include "mojo/shell/public/cpp/app_lifetime_helper.h" |
| 23 #include "mojo/shell/public/cpp/application_delegate.h" | 23 #include "mojo/shell/public/cpp/application_delegate.h" |
| 24 #include "mojo/shell/public/cpp/interface_factory.h" | 24 #include "mojo/shell/public/cpp/interface_factory.h" |
| 25 | 25 |
| 26 namespace mojo { | 26 namespace mojo { |
| 27 class ApplicationImpl; | 27 class Shell; |
| 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 16 matching lines...) Expand all Loading... |
| 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 // ApplicationDelegate: | 63 // ApplicationDelegate: |
| 64 void Initialize(mojo::ApplicationImpl* app) override; | 64 void Initialize(mojo::Shell* shell, const std::string& url, |
| 65 uint32_t id) override; |
| 65 bool AcceptConnection( | 66 bool AcceptConnection( |
| 66 mojo::ApplicationConnection* connection) override; | 67 mojo::ApplicationConnection* connection) override; |
| 67 | 68 |
| 68 // ConnectionManagerDelegate: | 69 // ConnectionManagerDelegate: |
| 69 void OnFirstRootConnectionCreated() override; | 70 void OnFirstRootConnectionCreated() override; |
| 70 void OnNoMoreRootConnections() override; | 71 void OnNoMoreRootConnections() override; |
| 71 ws::ClientConnection* CreateClientConnectionForEmbedAtWindow( | 72 ws::ClientConnection* CreateClientConnectionForEmbedAtWindow( |
| 72 ws::ConnectionManager* connection_manager, | 73 ws::ConnectionManager* connection_manager, |
| 73 mojo::InterfaceRequest<mojom::WindowTree> tree_request, | 74 mojo::InterfaceRequest<mojom::WindowTree> tree_request, |
| 74 ws::ServerWindow* root, | 75 ws::ServerWindow* root, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 96 | 97 |
| 97 // mojo::InterfaceFactory<mojom::Gpu> implementation. | 98 // mojo::InterfaceFactory<mojom::Gpu> implementation. |
| 98 void Create(mojo::ApplicationConnection* connection, | 99 void Create(mojo::ApplicationConnection* connection, |
| 99 mojo::InterfaceRequest<mojom::Gpu> request) override; | 100 mojo::InterfaceRequest<mojom::Gpu> request) override; |
| 100 | 101 |
| 101 // mojom::WindowTreeHostFactory implementation. | 102 // mojom::WindowTreeHostFactory implementation. |
| 102 void CreateWindowTreeHost(mojo::InterfaceRequest<mojom::WindowTreeHost> host, | 103 void CreateWindowTreeHost(mojo::InterfaceRequest<mojom::WindowTreeHost> host, |
| 103 mojom::WindowTreeClientPtr tree_client) override; | 104 mojom::WindowTreeClientPtr tree_client) override; |
| 104 | 105 |
| 105 mojo::WeakBindingSet<mojom::WindowTreeHostFactory> factory_bindings_; | 106 mojo::WeakBindingSet<mojom::WindowTreeHostFactory> factory_bindings_; |
| 106 mojo::ApplicationImpl* app_impl_; | 107 mojo::Shell* shell_; |
| 107 scoped_ptr<ws::ConnectionManager> connection_manager_; | 108 scoped_ptr<ws::ConnectionManager> connection_manager_; |
| 108 scoped_refptr<GpuState> gpu_state_; | 109 scoped_refptr<GpuState> gpu_state_; |
| 109 scoped_ptr<ui::PlatformEventSource> event_source_; | 110 scoped_ptr<ui::PlatformEventSource> event_source_; |
| 110 mojo::TracingImpl tracing_; | 111 mojo::TracingImpl tracing_; |
| 111 using PendingRequests = std::vector<scoped_ptr<PendingRequest>>; | 112 using PendingRequests = std::vector<scoped_ptr<PendingRequest>>; |
| 112 PendingRequests pending_requests_; | 113 PendingRequests pending_requests_; |
| 113 scoped_ptr<ws::WindowTreeFactory> window_tree_factory_; | 114 scoped_ptr<ws::WindowTreeFactory> window_tree_factory_; |
| 114 | 115 |
| 115 // Surfaces | 116 // Surfaces |
| 116 scoped_refptr<SurfacesState> surfaces_state_; | 117 scoped_refptr<SurfacesState> surfaces_state_; |
| 117 | 118 |
| 118 DISALLOW_COPY_AND_ASSIGN(MandolineUIServicesApp); | 119 DISALLOW_COPY_AND_ASSIGN(MandolineUIServicesApp); |
| 119 }; | 120 }; |
| 120 | 121 |
| 121 } // namespace mus | 122 } // namespace mus |
| 122 | 123 |
| 123 #endif // COMPONENTS_MUS_MUS_APP_H_ | 124 #endif // COMPONENTS_MUS_MUS_APP_H_ |
| OLD | NEW |