| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/utility/chrome_content_utility_client.h" | 5 #include "chrome/utility/chrome_content_utility_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "services/image_decoder/public/interfaces/constants.mojom.h" | 29 #include "services/image_decoder/public/interfaces/constants.mojom.h" |
| 30 #include "services/service_manager/public/cpp/interface_registry.h" | 30 #include "services/service_manager/public/cpp/interface_registry.h" |
| 31 #include "third_party/zlib/google/zip.h" | 31 #include "third_party/zlib/google/zip.h" |
| 32 | 32 |
| 33 #if !defined(OS_ANDROID) | 33 #if !defined(OS_ANDROID) |
| 34 #include "chrome/common/resource_usage_reporter.mojom.h" | 34 #include "chrome/common/resource_usage_reporter.mojom.h" |
| 35 #include "chrome/utility/profile_import_handler.h" | 35 #include "chrome/utility/profile_import_handler.h" |
| 36 #include "mojo/public/cpp/bindings/strong_binding.h" | 36 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 37 #include "net/proxy/mojo_proxy_resolver_factory_impl.h" | 37 #include "net/proxy/mojo_proxy_resolver_factory_impl.h" |
| 38 #include "net/proxy/proxy_resolver_v8.h" | 38 #include "net/proxy/proxy_resolver_v8.h" |
| 39 #else |
| 40 #include "components/payments/content/android/utility/payment_manifest_parser.h" |
| 39 #endif | 41 #endif |
| 40 | 42 |
| 41 #if defined(OS_CHROMEOS) | 43 #if defined(OS_CHROMEOS) |
| 42 #include "chrome/common/zip_file_creator.mojom.h" | 44 #include "chrome/common/zip_file_creator.mojom.h" |
| 43 #endif | 45 #endif |
| 44 | 46 |
| 45 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
| 46 #include "chrome/utility/ipc_shell_handler_win.h" | 48 #include "chrome/utility/ipc_shell_handler_win.h" |
| 47 #include "chrome/utility/shell_handler_impl_win.h" | 49 #include "chrome/utility/shell_handler_impl_win.h" |
| 48 #endif | 50 #endif |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 // services to the interface registry. | 270 // services to the interface registry. |
| 269 if (utility_process_running_elevated_) | 271 if (utility_process_running_elevated_) |
| 270 return; | 272 return; |
| 271 | 273 |
| 272 registry->AddInterface(base::Bind(&FilePatcherImpl::Create)); | 274 registry->AddInterface(base::Bind(&FilePatcherImpl::Create)); |
| 273 #if !defined(OS_ANDROID) | 275 #if !defined(OS_ANDROID) |
| 274 registry->AddInterface<net::interfaces::ProxyResolverFactory>( | 276 registry->AddInterface<net::interfaces::ProxyResolverFactory>( |
| 275 base::Bind(CreateProxyResolverFactory)); | 277 base::Bind(CreateProxyResolverFactory)); |
| 276 registry->AddInterface(base::Bind(CreateResourceUsageReporter)); | 278 registry->AddInterface(base::Bind(CreateResourceUsageReporter)); |
| 277 registry->AddInterface(base::Bind(&ProfileImportHandler::Create)); | 279 registry->AddInterface(base::Bind(&ProfileImportHandler::Create)); |
| 280 #else |
| 281 registry->AddInterface(base::Bind(&payments::PaymentManifestParser::Create)); |
| 278 #endif | 282 #endif |
| 279 registry->AddInterface( | 283 registry->AddInterface( |
| 280 base::Bind(&safe_json::SafeJsonParserMojoImpl::Create)); | 284 base::Bind(&safe_json::SafeJsonParserMojoImpl::Create)); |
| 281 #if defined(OS_WIN) | 285 #if defined(OS_WIN) |
| 282 registry->AddInterface(base::Bind(&ShellHandlerImpl::Create)); | 286 registry->AddInterface(base::Bind(&ShellHandlerImpl::Create)); |
| 283 #endif | 287 #endif |
| 284 #if defined(OS_CHROMEOS) | 288 #if defined(OS_CHROMEOS) |
| 285 registry->AddInterface(base::Bind(&ZipFileCreatorImpl::Create)); | 289 registry->AddInterface(base::Bind(&ZipFileCreatorImpl::Create)); |
| 286 #endif | 290 #endif |
| 287 #if defined(FULL_SAFE_BROWSING) | 291 #if defined(FULL_SAFE_BROWSING) |
| 288 registry->AddInterface(base::Bind(&SafeArchiveAnalyzerImpl::Create)); | 292 registry->AddInterface(base::Bind(&SafeArchiveAnalyzerImpl::Create)); |
| 289 #endif | 293 #endif |
| 290 } | 294 } |
| 291 | 295 |
| 292 void ChromeContentUtilityClient::RegisterServices(StaticServiceMap* services) { | 296 void ChromeContentUtilityClient::RegisterServices(StaticServiceMap* services) { |
| 293 content::ServiceInfo image_decoder_info; | 297 content::ServiceInfo image_decoder_info; |
| 294 image_decoder_info.factory = base::Bind(&CreateImageDecoderService); | 298 image_decoder_info.factory = base::Bind(&CreateImageDecoderService); |
| 295 services->insert( | 299 services->insert( |
| 296 std::make_pair(image_decoder::mojom::kServiceName, image_decoder_info)); | 300 std::make_pair(image_decoder::mojom::kServiceName, image_decoder_info)); |
| 297 } | 301 } |
| 298 | 302 |
| 299 // static | 303 // static |
| 300 void ChromeContentUtilityClient::PreSandboxStartup() { | 304 void ChromeContentUtilityClient::PreSandboxStartup() { |
| 301 #if BUILDFLAG(ENABLE_EXTENSIONS) | 305 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 302 extensions::ExtensionsHandler::PreSandboxStartup(); | 306 extensions::ExtensionsHandler::PreSandboxStartup(); |
| 303 #endif | 307 #endif |
| 304 } | 308 } |
| OLD | NEW |