| 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/application/public/interfaces/application.mojom.h" | 14 #include "mojo/application/public/interfaces/application.mojom.h" |
| 15 #include "mojo/application/public/interfaces/service_provider.mojom.h" | 15 #include "mojo/application/public/interfaces/service_provider.mojom.h" |
| 16 #include "mojo/public/cpp/bindings/interface_ptr_info.h" | 16 #include "mojo/public/cpp/bindings/interface_ptr_info.h" |
| 17 #include "mojo/public/cpp/bindings/interface_request.h" | 17 #include "mojo/public/cpp/bindings/interface_request.h" |
| 18 #include "mojo/services/network/public/interfaces/network_service.mojom.h" |
| 18 #include "mojo/services/network/public/interfaces/url_loader_factory.mojom.h" | 19 #include "mojo/services/network/public/interfaces/url_loader_factory.mojom.h" |
| 19 #include "mojo/services/updater/updater.mojom.h" | 20 #include "mojo/services/updater/updater.mojom.h" |
| 20 #include "mojo/shell/application_loader.h" | 21 #include "mojo/shell/application_loader.h" |
| 21 #include "mojo/shell/fetcher.h" | 22 #include "mojo/shell/fetcher.h" |
| 22 #include "mojo/shell/identity.h" | 23 #include "mojo/shell/identity.h" |
| 23 #include "mojo/shell/native_runner.h" | 24 #include "mojo/shell/native_runner.h" |
| 24 #include "url/gurl.h" | 25 #include "url/gurl.h" |
| 25 | 26 |
| 26 namespace base { | 27 namespace base { |
| 27 class FilePath; | 28 class FilePath; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 207 |
| 207 void RunNativeApplication(InterfaceRequest<Application> application_request, | 208 void RunNativeApplication(InterfaceRequest<Application> application_request, |
| 208 const NativeRunnerFactory::Options& options, | 209 const NativeRunnerFactory::Options& options, |
| 209 NativeApplicationCleanup cleanup, | 210 NativeApplicationCleanup cleanup, |
| 210 scoped_ptr<Fetcher> fetcher, | 211 scoped_ptr<Fetcher> fetcher, |
| 211 const base::FilePath& file_path, | 212 const base::FilePath& file_path, |
| 212 bool path_exists); | 213 bool path_exists); |
| 213 | 214 |
| 214 void LoadWithContentHandler(const GURL& content_handler_url, | 215 void LoadWithContentHandler(const GURL& content_handler_url, |
| 215 const GURL& requestor_url, | 216 const GURL& requestor_url, |
| 216 const std::string& qualifier, | |
| 217 InterfaceRequest<Application> application_request, | 217 InterfaceRequest<Application> application_request, |
| 218 URLResponsePtr url_response); | 218 URLResponsePtr url_response, |
| 219 const std::string& qualifier); |
| 219 | 220 |
| 220 // Returns the appropriate loader for |url|, or null if there is no loader | 221 // Returns the appropriate loader for |url|, or null if there is no loader |
| 221 // configured for the URL. | 222 // configured for the URL. |
| 222 ApplicationLoader* GetLoaderForURL(const GURL& url); | 223 ApplicationLoader* GetLoaderForURL(const GURL& url); |
| 223 | 224 |
| 224 void CleanupRunner(NativeRunner* runner); | 225 void CleanupRunner(NativeRunner* runner); |
| 225 | 226 |
| 226 Delegate* const delegate_; | 227 Delegate* const delegate_; |
| 227 // Loader management. | 228 // Loader management. |
| 228 // Loaders are chosen in the order they are listed here. | 229 // Loaders are chosen in the order they are listed here. |
| 229 URLToLoaderMap url_to_loader_; | 230 URLToLoaderMap url_to_loader_; |
| 230 SchemeToLoaderMap scheme_to_loader_; | 231 SchemeToLoaderMap scheme_to_loader_; |
| 231 scoped_ptr<ApplicationLoader> default_loader_; | 232 scoped_ptr<ApplicationLoader> default_loader_; |
| 232 scoped_ptr<NativeRunnerFactory> native_runner_factory_; | 233 scoped_ptr<NativeRunnerFactory> native_runner_factory_; |
| 233 | 234 |
| 234 ApplicationPackagedAlias application_package_alias_; | 235 ApplicationPackagedAlias application_package_alias_; |
| 235 IdentityToShellImplMap identity_to_shell_impl_; | 236 IdentityToShellImplMap identity_to_shell_impl_; |
| 236 URLToContentHandlerMap url_to_content_handler_; | 237 URLToContentHandlerMap url_to_content_handler_; |
| 237 // Note: The keys are URLs after mapping and resolving. | 238 // Note: The keys are URLs after mapping and resolving. |
| 238 URLToNativeOptionsMap url_to_native_options_; | 239 URLToNativeOptionsMap url_to_native_options_; |
| 239 | 240 |
| 240 base::SequencedWorkerPool* blocking_pool_; | 241 base::SequencedWorkerPool* blocking_pool_; |
| 241 URLLoaderFactoryPtr url_loader_factory_; | 242 URLLoaderFactoryPtr url_loader_factory_; |
| 242 updater::UpdaterPtr updater_; | 243 updater::UpdaterPtr updater_; |
| 243 MimeTypeToURLMap mime_type_to_url_; | 244 MimeTypeToURLMap mime_type_to_url_; |
| 244 ScopedVector<NativeRunner> native_runners_; | 245 ScopedVector<NativeRunner> native_runners_; |
| 246 NetworkServicePtr network_service_; |
| 245 bool disable_cache_; | 247 bool disable_cache_; |
| 246 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; | 248 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; |
| 247 | 249 |
| 248 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); | 250 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); |
| 249 }; | 251 }; |
| 250 | 252 |
| 251 } // namespace shell | 253 } // namespace shell |
| 252 } // namespace mojo | 254 } // namespace mojo |
| 253 | 255 |
| 254 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 256 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ |
| OLD | NEW |