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/identity.h" | 20 #include "mojo/shell/identity.h" |
20 #include "mojo/shell/native_runner.h" | 21 #include "mojo/shell/native_runner.h" |
21 #include "url/gurl.h" | 22 #include "url/gurl.h" |
22 | 23 |
23 namespace base { | 24 namespace base { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 const GURL& requestor_url, | 73 const GURL& requestor_url, |
73 InterfaceRequest<ServiceProvider> services, | 74 InterfaceRequest<ServiceProvider> services, |
74 ServiceProviderPtr exposed_services, | 75 ServiceProviderPtr exposed_services, |
75 const base::Closure& on_application_end); | 76 const base::Closure& on_application_end); |
76 | 77 |
77 template <typename Interface> | 78 template <typename Interface> |
78 inline void ConnectToService(const GURL& application_url, | 79 inline void ConnectToService(const GURL& application_url, |
79 InterfacePtr<Interface>* ptr) { | 80 InterfacePtr<Interface>* ptr) { |
80 ScopedMessagePipeHandle service_handle = | 81 ScopedMessagePipeHandle service_handle = |
81 ConnectToServiceByName(application_url, Interface::Name_); | 82 ConnectToServiceByName(application_url, Interface::Name_); |
82 ptr->Bind(service_handle.Pass()); | 83 ptr->Bind(InterfacePtrInfo<Interface>(service_handle.Pass(), 0u)); |
83 } | 84 } |
84 | 85 |
85 ScopedMessagePipeHandle ConnectToServiceByName( | 86 ScopedMessagePipeHandle ConnectToServiceByName( |
86 const GURL& application_url, | 87 const GURL& application_url, |
87 const std::string& interface_name); | 88 const std::string& interface_name); |
88 | 89 |
89 void RegisterContentHandler(const std::string& mime_type, | 90 void RegisterContentHandler(const std::string& mime_type, |
90 const GURL& content_handler_url); | 91 const GURL& content_handler_url); |
91 | 92 |
92 // Registers a package alias. When attempting to load |alias|, it will | 93 // Registers a package alias. When attempting to load |alias|, it will |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 bool disable_cache_; | 234 bool disable_cache_; |
234 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; | 235 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; |
235 | 236 |
236 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); | 237 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); |
237 }; | 238 }; |
238 | 239 |
239 } // namespace shell | 240 } // namespace shell |
240 } // namespace mojo | 241 } // namespace mojo |
241 | 242 |
242 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 243 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ |
OLD | NEW |