| 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 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 std::unique_ptr<service_manager::Service> CreateImageDecoderService() { | 107 std::unique_ptr<service_manager::Service> CreateImageDecoderService() { |
| 108 content::UtilityThread::Get()->EnsureBlinkInitialized(); | 108 content::UtilityThread::Get()->EnsureBlinkInitialized(); |
| 109 return image_decoder::ImageDecoderService::Create(); | 109 return image_decoder::ImageDecoderService::Create(); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace | 112 } // namespace |
| 113 | 113 |
| 114 ChromeContentUtilityClient::ChromeContentUtilityClient() | 114 ChromeContentUtilityClient::ChromeContentUtilityClient() |
| 115 : filter_messages_(false) { | 115 : filter_messages_(false) { |
| 116 #if !defined(OS_ANDROID) | |
| 117 handlers_.push_back(new ProfileImportHandler()); | |
| 118 #endif | |
| 119 | |
| 120 #if BUILDFLAG(ENABLE_EXTENSIONS) | 116 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 121 handlers_.push_back(new extensions::ExtensionsHandler(this)); | 117 handlers_.push_back(new extensions::ExtensionsHandler(this)); |
| 122 handlers_.push_back(new image_writer::ImageWriterHandler()); | 118 handlers_.push_back(new image_writer::ImageWriterHandler()); |
| 123 #endif | 119 #endif |
| 124 | 120 |
| 125 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \ | 121 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \ |
| 126 (BUILDFLAG(ENABLE_BASIC_PRINTING) && defined(OS_WIN)) | 122 (BUILDFLAG(ENABLE_BASIC_PRINTING) && defined(OS_WIN)) |
| 127 handlers_.push_back(new printing::PrintingHandler()); | 123 handlers_.push_back(new printing::PrintingHandler()); |
| 128 #endif | 124 #endif |
| 129 | 125 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 // non-whitelisted Mojo services to the service_manager::InterfaceRegistry. | 197 // non-whitelisted Mojo services to the service_manager::InterfaceRegistry. |
| 202 // TODO(amistry): Use a whitelist once the whistlisted IPCs have been | 198 // TODO(amistry): Use a whitelist once the whistlisted IPCs have been |
| 203 // converted to Mojo. | 199 // converted to Mojo. |
| 204 if (filter_messages_) | 200 if (filter_messages_) |
| 205 return; | 201 return; |
| 206 | 202 |
| 207 #if !defined(OS_ANDROID) | 203 #if !defined(OS_ANDROID) |
| 208 registry->AddInterface<net::interfaces::ProxyResolverFactory>( | 204 registry->AddInterface<net::interfaces::ProxyResolverFactory>( |
| 209 base::Bind(CreateProxyResolverFactory)); | 205 base::Bind(CreateProxyResolverFactory)); |
| 210 registry->AddInterface(base::Bind(CreateResourceUsageReporter)); | 206 registry->AddInterface(base::Bind(CreateResourceUsageReporter)); |
| 207 registry->AddInterface(base::Bind(ProfileImportHandler::Create)); |
| 211 #endif | 208 #endif |
| 212 registry->AddInterface( | 209 registry->AddInterface( |
| 213 base::Bind(&safe_json::SafeJsonParserMojoImpl::Create)); | 210 base::Bind(&safe_json::SafeJsonParserMojoImpl::Create)); |
| 214 #if defined(OS_WIN) | 211 #if defined(OS_WIN) |
| 215 registry->AddInterface(base::Bind(&ShellHandlerImpl::Create)); | 212 registry->AddInterface(base::Bind(&ShellHandlerImpl::Create)); |
| 216 #endif | 213 #endif |
| 217 } | 214 } |
| 218 | 215 |
| 219 void ChromeContentUtilityClient::RegisterServices(StaticServiceMap* services) { | 216 void ChromeContentUtilityClient::RegisterServices(StaticServiceMap* services) { |
| 220 content::ServiceInfo image_decoder_info; | 217 content::ServiceInfo image_decoder_info; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 safe_browsing::zip_analyzer::Results results; | 314 safe_browsing::zip_analyzer::Results results; |
| 318 safe_browsing::dmg::AnalyzeDMGFile( | 315 safe_browsing::dmg::AnalyzeDMGFile( |
| 319 IPC::PlatformFileForTransitToFile(dmg_file), &results); | 316 IPC::PlatformFileForTransitToFile(dmg_file), &results); |
| 320 Send(new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished( | 317 Send(new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished( |
| 321 results)); | 318 results)); |
| 322 ReleaseProcessIfNeeded(); | 319 ReleaseProcessIfNeeded(); |
| 323 } | 320 } |
| 324 #endif // defined(OS_MACOSX) | 321 #endif // defined(OS_MACOSX) |
| 325 | 322 |
| 326 #endif // defined(FULL_SAFE_BROWSING) | 323 #endif // defined(FULL_SAFE_BROWSING) |
| OLD | NEW |