| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 } // namespace | 112 } // namespace |
| 113 | 113 |
| 114 ChromeContentUtilityClient::ChromeContentUtilityClient() | 114 ChromeContentUtilityClient::ChromeContentUtilityClient() |
| 115 : filter_messages_(false) { | 115 : filter_messages_(false) { |
| 116 #if BUILDFLAG(ENABLE_EXTENSIONS) | 116 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 117 handlers_.push_back(new extensions::ExtensionsHandler(this)); | 117 handlers_.push_back(new extensions::ExtensionsHandler(this)); |
| 118 handlers_.push_back(new image_writer::ImageWriterHandler()); | 118 handlers_.push_back(new image_writer::ImageWriterHandler()); |
| 119 #endif | 119 #endif |
| 120 | 120 |
| 121 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \ | |
| 122 (BUILDFLAG(ENABLE_BASIC_PRINTING) && defined(OS_WIN)) | |
| 123 handlers_.push_back(new printing::PrintingHandler()); | |
| 124 #endif | |
| 125 | |
| 126 #if defined(OS_WIN) | 121 #if defined(OS_WIN) |
| 127 handlers_.push_back(new IPCShellHandler()); | 122 handlers_.push_back(new IPCShellHandler()); |
| 128 #endif | 123 #endif |
| 129 } | 124 } |
| 130 | 125 |
| 131 ChromeContentUtilityClient::~ChromeContentUtilityClient() { | 126 ChromeContentUtilityClient::~ChromeContentUtilityClient() { |
| 132 } | 127 } |
| 133 | 128 |
| 134 void ChromeContentUtilityClient::UtilityThreadStarted() { | 129 void ChromeContentUtilityClient::UtilityThreadStarted() { |
| 135 #if BUILDFLAG(ENABLE_EXTENSIONS) | 130 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 registry->AddInterface<net::interfaces::ProxyResolverFactory>( | 199 registry->AddInterface<net::interfaces::ProxyResolverFactory>( |
| 205 base::Bind(CreateProxyResolverFactory)); | 200 base::Bind(CreateProxyResolverFactory)); |
| 206 registry->AddInterface(base::Bind(CreateResourceUsageReporter)); | 201 registry->AddInterface(base::Bind(CreateResourceUsageReporter)); |
| 207 registry->AddInterface(base::Bind(&ProfileImportHandler::Create)); | 202 registry->AddInterface(base::Bind(&ProfileImportHandler::Create)); |
| 208 #endif | 203 #endif |
| 209 registry->AddInterface( | 204 registry->AddInterface( |
| 210 base::Bind(&safe_json::SafeJsonParserMojoImpl::Create)); | 205 base::Bind(&safe_json::SafeJsonParserMojoImpl::Create)); |
| 211 #if defined(OS_WIN) | 206 #if defined(OS_WIN) |
| 212 registry->AddInterface(base::Bind(&ShellHandlerImpl::Create)); | 207 registry->AddInterface(base::Bind(&ShellHandlerImpl::Create)); |
| 213 #endif | 208 #endif |
| 209 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \ |
| 210 (BUILDFLAG(ENABLE_BASIC_PRINTING) && defined(OS_WIN)) |
| 211 registry->AddInterface(base::Bind(&printing::PrintingHandler::Create)); |
| 212 #endif |
| 214 } | 213 } |
| 215 | 214 |
| 216 void ChromeContentUtilityClient::RegisterServices(StaticServiceMap* services) { | 215 void ChromeContentUtilityClient::RegisterServices(StaticServiceMap* services) { |
| 217 content::ServiceInfo image_decoder_info; | 216 content::ServiceInfo image_decoder_info; |
| 218 image_decoder_info.factory = base::Bind(&CreateImageDecoderService); | 217 image_decoder_info.factory = base::Bind(&CreateImageDecoderService); |
| 219 services->insert( | 218 services->insert( |
| 220 std::make_pair(image_decoder::mojom::kServiceName, image_decoder_info)); | 219 std::make_pair(image_decoder::mojom::kServiceName, image_decoder_info)); |
| 221 } | 220 } |
| 222 | 221 |
| 223 void ChromeContentUtilityClient::AddHandler( | 222 void ChromeContentUtilityClient::AddHandler( |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 safe_browsing::zip_analyzer::Results results; | 306 safe_browsing::zip_analyzer::Results results; |
| 308 safe_browsing::dmg::AnalyzeDMGFile( | 307 safe_browsing::dmg::AnalyzeDMGFile( |
| 309 IPC::PlatformFileForTransitToFile(dmg_file), &results); | 308 IPC::PlatformFileForTransitToFile(dmg_file), &results); |
| 310 Send(new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished( | 309 Send(new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished( |
| 311 results)); | 310 results)); |
| 312 ReleaseProcessIfNeeded(); | 311 ReleaseProcessIfNeeded(); |
| 313 } | 312 } |
| 314 #endif // defined(OS_MACOSX) | 313 #endif // defined(OS_MACOSX) |
| 315 | 314 |
| 316 #endif // defined(FULL_SAFE_BROWSING) | 315 #endif // defined(FULL_SAFE_BROWSING) |
| OLD | NEW |