OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_MOJO_CONNECTION_LISTENER_H_ |
| 6 #define CONTENT_BROWSER_MOJO_CONNECTION_LISTENER_H_ |
| 7 |
| 8 #include "content/public/common/mojo_shell_connection.h" |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "content/browser/render_widget_view.mojom.h" |
| 12 #include "mojo/application/public/cpp/interface_factory.h" |
| 13 #include "mojo/common/weak_binding_set.h" |
| 14 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 15 |
| 16 namespace content { |
| 17 |
| 18 class RenderWidgetViewFactoryImpl : public mojom::RenderWidgetViewFactory { |
| 19 public: |
| 20 RenderWidgetViewFactoryImpl( |
| 21 int render_process_id, |
| 22 mojo::InterfaceRequest<mojom::RenderWidgetViewFactory> request); |
| 23 ~RenderWidgetViewFactoryImpl() override; |
| 24 |
| 25 private: |
| 26 // mojom::RenderWidgetViewFactory implementation. |
| 27 void CreateRenderWidgetView( |
| 28 uint32_t routing_id, |
| 29 mus::mojom::WindowTreeClientPtr tree_client) override; |
| 30 |
| 31 const int render_process_id_; |
| 32 mojo::StrongBinding<RenderWidgetViewFactory> binding_; |
| 33 DISALLOW_COPY_AND_ASSIGN(RenderWidgetViewFactoryImpl); |
| 34 }; |
| 35 |
| 36 class RenderWidgetViewServiceListener : |
| 37 public MojoShellConnection::Listener, |
| 38 public mojo::InterfaceFactory<mojom::RenderWidgetViewFactory> { |
| 39 public: |
| 40 static void Create(); |
| 41 |
| 42 private: |
| 43 RenderWidgetViewServiceListener(); |
| 44 ~RenderWidgetViewServiceListener() override; |
| 45 |
| 46 // MojoShellConnection::Listener implementation: |
| 47 bool ConfigureIncomingConnection( |
| 48 mojo::ApplicationConnection* connection) override; |
| 49 void OnDestroy() override; |
| 50 |
| 51 // mojo::InterfaceFactory<mojom::RenderWidgetViewFactory>: |
| 52 void Create( |
| 53 mojo::ApplicationConnection* connection, |
| 54 mojo::InterfaceRequest<mojom::RenderWidgetViewFactory> request) override; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(RenderWidgetViewServiceListener); |
| 57 }; |
| 58 |
| 59 } // namespace content |
| 60 |
| 61 #endif // CONTENT_BROWSER_MOJO_CONNECTION_LISTENER_H_ |
OLD | NEW |