| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 #if defined(ENABLE_EXTENSIONS) | 36 #if defined(ENABLE_EXTENSIONS) |
| 37 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" | 37 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" |
| 38 #include "chrome/utility/extensions/extensions_handler.h" | 38 #include "chrome/utility/extensions/extensions_handler.h" |
| 39 #include "chrome/utility/image_writer/image_writer_handler.h" | 39 #include "chrome/utility/image_writer/image_writer_handler.h" |
| 40 #include "chrome/utility/media_galleries/ipc_data_source.h" | 40 #include "chrome/utility/media_galleries/ipc_data_source.h" |
| 41 #include "chrome/utility/media_galleries/media_metadata_parser.h" | 41 #include "chrome/utility/media_galleries/media_metadata_parser.h" |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 #if defined(ENABLE_FULL_PRINTING) || defined(OS_WIN) | 44 #if defined(ENABLE_PRINT_PREVIEW) || defined(OS_WIN) |
| 45 #include "chrome/utility/printing_handler.h" | 45 #include "chrome/utility/printing_handler.h" |
| 46 #endif | 46 #endif |
| 47 | 47 |
| 48 #if defined(ENABLE_MDNS) | 48 #if defined(ENABLE_MDNS) |
| 49 #include "chrome/utility/local_discovery/service_discovery_message_handler.h" | 49 #include "chrome/utility/local_discovery/service_discovery_message_handler.h" |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 namespace { | 52 namespace { |
| 53 | 53 |
| 54 bool Send(IPC::Message* message) { | 54 bool Send(IPC::Message* message) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 79 : filter_messages_(false) { | 79 : filter_messages_(false) { |
| 80 #if !defined(OS_ANDROID) | 80 #if !defined(OS_ANDROID) |
| 81 handlers_.push_back(new ProfileImportHandler()); | 81 handlers_.push_back(new ProfileImportHandler()); |
| 82 #endif | 82 #endif |
| 83 | 83 |
| 84 #if defined(ENABLE_EXTENSIONS) | 84 #if defined(ENABLE_EXTENSIONS) |
| 85 handlers_.push_back(new extensions::ExtensionsHandler()); | 85 handlers_.push_back(new extensions::ExtensionsHandler()); |
| 86 handlers_.push_back(new image_writer::ImageWriterHandler()); | 86 handlers_.push_back(new image_writer::ImageWriterHandler()); |
| 87 #endif | 87 #endif |
| 88 | 88 |
| 89 #if defined(ENABLE_FULL_PRINTING) || defined(OS_WIN) | 89 #if defined(ENABLE_PRINT_PREVIEW) || defined(OS_WIN) |
| 90 handlers_.push_back(new PrintingHandler()); | 90 handlers_.push_back(new PrintingHandler()); |
| 91 #endif | 91 #endif |
| 92 | 92 |
| 93 #if defined(ENABLE_MDNS) | 93 #if defined(ENABLE_MDNS) |
| 94 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 94 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 95 switches::kUtilityProcessEnableMDns)) { | 95 switches::kUtilityProcessEnableMDns)) { |
| 96 handlers_.push_back(new local_discovery::ServiceDiscoveryMessageHandler()); | 96 handlers_.push_back(new local_discovery::ServiceDiscoveryMessageHandler()); |
| 97 } | 97 } |
| 98 #endif | 98 #endif |
| 99 | 99 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 return handled; | 159 return handled; |
| 160 } | 160 } |
| 161 | 161 |
| 162 // static | 162 // static |
| 163 void ChromeContentUtilityClient::PreSandboxStartup() { | 163 void ChromeContentUtilityClient::PreSandboxStartup() { |
| 164 #if defined(ENABLE_EXTENSIONS) | 164 #if defined(ENABLE_EXTENSIONS) |
| 165 extensions::ExtensionsHandler::PreSandboxStartup(); | 165 extensions::ExtensionsHandler::PreSandboxStartup(); |
| 166 #endif | 166 #endif |
| 167 | 167 |
| 168 #if defined(ENABLE_FULL_PRINTING) || defined(OS_WIN) | 168 #if defined(ENABLE_PRINT_PREVIEW) || defined(OS_WIN) |
| 169 PrintingHandler::PreSandboxStartup(); | 169 PrintingHandler::PreSandboxStartup(); |
| 170 #endif | 170 #endif |
| 171 | 171 |
| 172 #if defined(ENABLE_MDNS) | 172 #if defined(ENABLE_MDNS) |
| 173 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 173 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 174 switches::kUtilityProcessEnableMDns)) { | 174 switches::kUtilityProcessEnableMDns)) { |
| 175 local_discovery::ServiceDiscoveryMessageHandler::PreSandboxStartup(); | 175 local_discovery::ServiceDiscoveryMessageHandler::PreSandboxStartup(); |
| 176 } | 176 } |
| 177 #endif // ENABLE_MDNS | 177 #endif // ENABLE_MDNS |
| 178 } | 178 } |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 const std::string& mime_type, int64 total_size, bool get_attached_images) { | 346 const std::string& mime_type, int64 total_size, bool get_attached_images) { |
| 347 // Only one IPCDataSource may be created and added to the list of handlers. | 347 // Only one IPCDataSource may be created and added to the list of handlers. |
| 348 metadata::IPCDataSource* source = new metadata::IPCDataSource(total_size); | 348 metadata::IPCDataSource* source = new metadata::IPCDataSource(total_size); |
| 349 handlers_.push_back(source); | 349 handlers_.push_back(source); |
| 350 | 350 |
| 351 metadata::MediaMetadataParser* parser = new metadata::MediaMetadataParser( | 351 metadata::MediaMetadataParser* parser = new metadata::MediaMetadataParser( |
| 352 source, mime_type, get_attached_images); | 352 source, mime_type, get_attached_images); |
| 353 parser->Start(base::Bind(&FinishParseMediaMetadata, base::Owned(parser))); | 353 parser->Start(base::Bind(&FinishParseMediaMetadata, base::Owned(parser))); |
| 354 } | 354 } |
| 355 #endif | 355 #endif |
| OLD | NEW |