| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 #if BUILDFLAG(ENABLE_EXTENSIONS) | 50 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 51 #include "chrome/utility/extensions/extensions_handler.h" | 51 #include "chrome/utility/extensions/extensions_handler.h" |
| 52 #endif | 52 #endif |
| 53 | 53 |
| 54 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \ | 54 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \ |
| 55 (BUILDFLAG(ENABLE_BASIC_PRINTING) && defined(OS_WIN)) | 55 (BUILDFLAG(ENABLE_BASIC_PRINTING) && defined(OS_WIN)) |
| 56 #include "chrome/utility/printing_handler.h" | 56 #include "chrome/utility/printing_handler.h" |
| 57 #endif | 57 #endif |
| 58 | 58 |
| 59 #if BUILDFLAG(ENABLE_PRINTING) |
| 60 #include "chrome/common/chrome_content_client.h" |
| 61 #include "components/printing/service/public/cpp/pdf_compositor_service_factory.
h" |
| 62 #include "components/printing/service/public/interfaces/pdf_compositor.mojom.h"
// nogncheck |
| 63 #endif |
| 64 |
| 59 #if defined(FULL_SAFE_BROWSING) | 65 #if defined(FULL_SAFE_BROWSING) |
| 60 #include "chrome/common/safe_archive_analyzer.mojom.h" | 66 #include "chrome/common/safe_archive_analyzer.mojom.h" |
| 61 #include "chrome/common/safe_browsing/zip_analyzer.h" | 67 #include "chrome/common/safe_browsing/zip_analyzer.h" |
| 62 #include "chrome/common/safe_browsing/zip_analyzer_results.h" | 68 #include "chrome/common/safe_browsing/zip_analyzer_results.h" |
| 63 #if defined(OS_MACOSX) | 69 #if defined(OS_MACOSX) |
| 64 #include "chrome/utility/safe_browsing/mac/dmg_analyzer.h" | 70 #include "chrome/utility/safe_browsing/mac/dmg_analyzer.h" |
| 65 #endif | 71 #endif |
| 66 #endif | 72 #endif |
| 67 | 73 |
| 68 namespace { | 74 namespace { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 return false; | 307 return false; |
| 302 | 308 |
| 303 for (const auto& handler : handlers_) { | 309 for (const auto& handler : handlers_) { |
| 304 if (handler->OnMessageReceived(message)) | 310 if (handler->OnMessageReceived(message)) |
| 305 return true; | 311 return true; |
| 306 } | 312 } |
| 307 | 313 |
| 308 return false; | 314 return false; |
| 309 } | 315 } |
| 310 | 316 |
| 317 void ChromeContentUtilityClient::RegisterServices( |
| 318 ChromeContentUtilityClient::StaticServiceMap* services) { |
| 319 #if BUILDFLAG(ENABLE_PRINTING) |
| 320 content::ServiceInfo pdf_compositor_info; |
| 321 pdf_compositor_info.factory = |
| 322 base::Bind(&printing::CreatePdfCompositorService, GetUserAgent()); |
| 323 services->insert( |
| 324 std::make_pair(printing::mojom::kServiceName, pdf_compositor_info)); |
| 325 #endif |
| 326 } |
| 327 |
| 311 // static | 328 // static |
| 312 void ChromeContentUtilityClient::PreSandboxStartup() { | 329 void ChromeContentUtilityClient::PreSandboxStartup() { |
| 313 #if BUILDFLAG(ENABLE_EXTENSIONS) | 330 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 314 extensions::ExtensionsHandler::PreSandboxStartup(); | 331 extensions::ExtensionsHandler::PreSandboxStartup(); |
| 315 #endif | 332 #endif |
| 316 } | 333 } |
| OLD | NEW |