| 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 SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 5 #ifndef SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ |
| 6 #define SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 6 #define SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "mojo/public/cpp/bindings/interface_ptr_info.h" |
| 14 #include "mojo/public/cpp/bindings/interface_request.h" | 15 #include "mojo/public/cpp/bindings/interface_request.h" |
| 15 #include "mojo/public/interfaces/application/application.mojom.h" | 16 #include "mojo/public/interfaces/application/application.mojom.h" |
| 16 #include "mojo/public/interfaces/application/service_provider.mojom.h" | 17 #include "mojo/public/interfaces/application/service_provider.mojom.h" |
| 17 #include "mojo/services/network/public/interfaces/network_service.mojom.h" | 18 #include "mojo/services/network/public/interfaces/network_service.mojom.h" |
| 18 #include "mojo/shell/application_loader.h" | 19 #include "mojo/shell/application_loader.h" |
| 19 #include "mojo/shell/fetcher.h" | 20 #include "mojo/shell/fetcher.h" |
| 20 #include "mojo/shell/identity.h" | 21 #include "mojo/shell/identity.h" |
| 21 #include "mojo/shell/native_runner.h" | 22 #include "mojo/shell/native_runner.h" |
| 22 #include "url/gurl.h" | 23 #include "url/gurl.h" |
| 23 | 24 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 const GURL& requestor_url, | 79 const GURL& requestor_url, |
| 79 InterfaceRequest<ServiceProvider> services, | 80 InterfaceRequest<ServiceProvider> services, |
| 80 ServiceProviderPtr exposed_services, | 81 ServiceProviderPtr exposed_services, |
| 81 const base::Closure& on_application_end); | 82 const base::Closure& on_application_end); |
| 82 | 83 |
| 83 template <typename Interface> | 84 template <typename Interface> |
| 84 inline void ConnectToService(const GURL& application_url, | 85 inline void ConnectToService(const GURL& application_url, |
| 85 InterfacePtr<Interface>* ptr) { | 86 InterfacePtr<Interface>* ptr) { |
| 86 ScopedMessagePipeHandle service_handle = | 87 ScopedMessagePipeHandle service_handle = |
| 87 ConnectToServiceByName(application_url, Interface::Name_); | 88 ConnectToServiceByName(application_url, Interface::Name_); |
| 88 ptr->Bind(service_handle.Pass()); | 89 ptr->Bind(InterfacePtrInfo<Interface>(service_handle.Pass(), 0u)); |
| 89 } | 90 } |
| 90 | 91 |
| 91 ScopedMessagePipeHandle ConnectToServiceByName( | 92 ScopedMessagePipeHandle ConnectToServiceByName( |
| 92 const GURL& application_url, | 93 const GURL& application_url, |
| 93 const std::string& interface_name); | 94 const std::string& interface_name); |
| 94 | 95 |
| 95 void RegisterContentHandler(const std::string& mime_type, | 96 void RegisterContentHandler(const std::string& mime_type, |
| 96 const GURL& content_handler_url); | 97 const GURL& content_handler_url); |
| 97 | 98 |
| 98 // Registers a package alias. When attempting to load |alias|, it will | 99 // Registers a package alias. When attempting to load |alias|, it will |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 bool disable_cache_; | 252 bool disable_cache_; |
| 252 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; | 253 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; |
| 253 | 254 |
| 254 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); | 255 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); |
| 255 }; | 256 }; |
| 256 | 257 |
| 257 } // namespace shell | 258 } // namespace shell |
| 258 } // namespace mojo | 259 } // namespace mojo |
| 259 | 260 |
| 260 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 261 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ |
| OLD | NEW |