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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 void CreateImageDecoder(mojo::InterfaceRequest<mojom::ImageDecoder> request) { | 102 void CreateImageDecoder(mojo::InterfaceRequest<mojom::ImageDecoder> request) { |
103 content::UtilityThread::Get()->EnsureBlinkInitialized(); | 103 content::UtilityThread::Get()->EnsureBlinkInitialized(); |
104 mojo::MakeStrongBinding(base::MakeUnique<ImageDecoderImpl>(), | 104 mojo::MakeStrongBinding(base::MakeUnique<ImageDecoderImpl>(), |
105 std::move(request)); | 105 std::move(request)); |
106 } | 106 } |
107 | 107 |
108 } // namespace | 108 } // namespace |
109 | 109 |
110 ChromeContentUtilityClient::ChromeContentUtilityClient() | 110 ChromeContentUtilityClient::ChromeContentUtilityClient() |
111 : filter_messages_(false) { | 111 : filter_messages_(false) { |
112 #if !defined(OS_ANDROID) | |
113 handlers_.push_back(new ProfileImportHandler()); | |
114 #endif | |
115 | |
116 #if defined(ENABLE_EXTENSIONS) | 112 #if defined(ENABLE_EXTENSIONS) |
117 handlers_.push_back(new extensions::ExtensionsHandler(this)); | 113 handlers_.push_back(new extensions::ExtensionsHandler(this)); |
118 handlers_.push_back(new image_writer::ImageWriterHandler()); | 114 handlers_.push_back(new image_writer::ImageWriterHandler()); |
119 #endif | 115 #endif |
120 | 116 |
121 #if defined(ENABLE_PRINT_PREVIEW) || \ | 117 #if defined(ENABLE_PRINT_PREVIEW) || \ |
122 (defined(ENABLE_BASIC_PRINTING) && defined(OS_WIN)) | 118 (defined(ENABLE_BASIC_PRINTING) && defined(OS_WIN)) |
123 handlers_.push_back(new printing::PrintingHandler()); | 119 handlers_.push_back(new printing::PrintingHandler()); |
124 #endif | 120 #endif |
125 | 121 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // non-whitelisted Mojo services to the service_manager::InterfaceRegistry. | 193 // non-whitelisted Mojo services to the service_manager::InterfaceRegistry. |
198 // TODO(amistry): Use a whitelist once the whistlisted IPCs have been | 194 // TODO(amistry): Use a whitelist once the whistlisted IPCs have been |
199 // converted to Mojo. | 195 // converted to Mojo. |
200 if (filter_messages_) | 196 if (filter_messages_) |
201 return; | 197 return; |
202 | 198 |
203 #if !defined(OS_ANDROID) | 199 #if !defined(OS_ANDROID) |
204 registry->AddInterface<net::interfaces::ProxyResolverFactory>( | 200 registry->AddInterface<net::interfaces::ProxyResolverFactory>( |
205 base::Bind(CreateProxyResolverFactory)); | 201 base::Bind(CreateProxyResolverFactory)); |
206 registry->AddInterface(base::Bind(CreateResourceUsageReporter)); | 202 registry->AddInterface(base::Bind(CreateResourceUsageReporter)); |
| 203 registry->AddInterface(base::Bind(ProfileImportHandler::Create)); |
207 #endif | 204 #endif |
208 registry->AddInterface(base::Bind(&CreateImageDecoder)); | 205 registry->AddInterface(base::Bind(&CreateImageDecoder)); |
209 registry->AddInterface( | 206 registry->AddInterface( |
210 base::Bind(&safe_json::SafeJsonParserMojoImpl::Create)); | 207 base::Bind(&safe_json::SafeJsonParserMojoImpl::Create)); |
211 #if defined(OS_WIN) | 208 #if defined(OS_WIN) |
212 registry->AddInterface(base::Bind(&ShellHandlerImpl::Create)); | 209 registry->AddInterface(base::Bind(&ShellHandlerImpl::Create)); |
213 #endif | 210 #endif |
214 } | 211 } |
215 | 212 |
216 void ChromeContentUtilityClient::AddHandler( | 213 void ChromeContentUtilityClient::AddHandler( |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 safe_browsing::zip_analyzer::Results results; | 304 safe_browsing::zip_analyzer::Results results; |
308 safe_browsing::dmg::AnalyzeDMGFile( | 305 safe_browsing::dmg::AnalyzeDMGFile( |
309 IPC::PlatformFileForTransitToFile(dmg_file), &results); | 306 IPC::PlatformFileForTransitToFile(dmg_file), &results); |
310 Send(new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished( | 307 Send(new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished( |
311 results)); | 308 results)); |
312 ReleaseProcessIfNeeded(); | 309 ReleaseProcessIfNeeded(); |
313 } | 310 } |
314 #endif // defined(OS_MACOSX) | 311 #endif // defined(OS_MACOSX) |
315 | 312 |
316 #endif // defined(FULL_SAFE_BROWSING) | 313 #endif // defined(FULL_SAFE_BROWSING) |
OLD | NEW |