| 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 CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_MOJO_SERVICE_MANAGER_CONTEXT_IMPL_H_ |
| 6 #define CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ | 6 #define CONTENT_BROWSER_MOJO_SERVICE_MANAGER_CONTEXT_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "content/common/content_export.h" | 15 #include "content/public/browser/service_manager_context.h" |
| 16 #include "services/shell/public/interfaces/connector.mojom.h" | 16 #include "services/shell/public/interfaces/connector.mojom.h" |
| 17 #include "services/shell/service_manager.h" | 17 #include "services/shell/service_manager.h" |
| 18 | 18 |
| 19 namespace catalog { | 19 namespace catalog { |
| 20 class Catalog; | 20 class Catalog; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 | 24 |
| 25 // MojoShellContext hosts the browser's ApplicationManager, coordinating | 25 class CONTENT_EXPORT ServiceManagerContextImpl : public ServiceManagerContext { |
| 26 // app registration and interconnection. | |
| 27 class CONTENT_EXPORT MojoShellContext { | |
| 28 public: | 26 public: |
| 29 MojoShellContext(); | 27 ServiceManagerContextImpl(); |
| 30 ~MojoShellContext(); | 28 ~ServiceManagerContextImpl(); |
| 31 | 29 |
| 32 // Connects an application at |name| and gets a handle to its exposed | 30 // Connects an application at |name| and gets a handle to its exposed |
| 33 // services. This is only intended for use in browser code that's not part of | 31 // services. This is only intended for use in browser code that's not part of |
| 34 // some Mojo application. May be called from any thread. |requestor_name| is | 32 // some Mojo application. May be called from any thread. |requestor_name| is |
| 35 // given to the target application as the requestor's name upon connection. | 33 // given to the target application as the requestor's name upon connection. |
| 36 static void ConnectToApplication( | 34 static void ConnectToApplication( |
| 37 const std::string& user_id, | 35 const std::string& user_id, |
| 38 const std::string& name, | 36 const std::string& name, |
| 39 const std::string& requestor_name, | 37 const std::string& requestor_name, |
| 40 shell::mojom::InterfaceProviderRequest request, | 38 shell::mojom::InterfaceProviderRequest request, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 56 shell::mojom::InterfaceProviderRequest request, | 54 shell::mojom::InterfaceProviderRequest request, |
| 57 shell::mojom::InterfaceProviderPtr exposed_services, | 55 shell::mojom::InterfaceProviderPtr exposed_services, |
| 58 const shell::mojom::Connector::ConnectCallback& callback); | 56 const shell::mojom::Connector::ConnectCallback& callback); |
| 59 | 57 |
| 60 static base::LazyInstance<std::unique_ptr<Proxy>> proxy_; | 58 static base::LazyInstance<std::unique_ptr<Proxy>> proxy_; |
| 61 | 59 |
| 62 std::unique_ptr<BuiltinManifestProvider> manifest_provider_; | 60 std::unique_ptr<BuiltinManifestProvider> manifest_provider_; |
| 63 std::unique_ptr<catalog::Catalog> catalog_; | 61 std::unique_ptr<catalog::Catalog> catalog_; |
| 64 std::unique_ptr<shell::ServiceManager> service_manager_; | 62 std::unique_ptr<shell::ServiceManager> service_manager_; |
| 65 | 63 |
| 66 DISALLOW_COPY_AND_ASSIGN(MojoShellContext); | 64 DISALLOW_COPY_AND_ASSIGN(ServiceManagerContextImpl); |
| 67 }; | 65 }; |
| 68 | 66 |
| 69 } // namespace content | 67 } // namespace content |
| 70 | 68 |
| 71 #endif // CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ | 69 #endif // CONTENT_BROWSER_MOJO_SERVICE_MANAGER_CONTEXT_IMPL_H_ |
| OLD | NEW |