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 21 matching lines...) Expand all Loading... |
32 #endif | 32 #endif |
33 | 33 |
34 #if defined(ENABLE_EXTENSIONS) | 34 #if defined(ENABLE_EXTENSIONS) |
35 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" | 35 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" |
36 #include "chrome/utility/extensions/extensions_handler.h" | 36 #include "chrome/utility/extensions/extensions_handler.h" |
37 #include "chrome/utility/image_writer/image_writer_handler.h" | 37 #include "chrome/utility/image_writer/image_writer_handler.h" |
38 #include "chrome/utility/media_galleries/ipc_data_source.h" | 38 #include "chrome/utility/media_galleries/ipc_data_source.h" |
39 #include "chrome/utility/media_galleries/media_metadata_parser.h" | 39 #include "chrome/utility/media_galleries/media_metadata_parser.h" |
40 #endif | 40 #endif |
41 | 41 |
42 #if defined(ENABLE_FULL_PRINTING) | 42 #if defined(ENABLE_FULL_PRINTING) || defined(OS_WIN) |
43 #include "chrome/utility/printing_handler.h" | 43 #include "chrome/utility/printing_handler.h" |
44 #endif | 44 #endif |
45 | 45 |
46 #if defined(ENABLE_MDNS) | 46 #if defined(ENABLE_MDNS) |
47 #include "chrome/utility/local_discovery/service_discovery_message_handler.h" | 47 #include "chrome/utility/local_discovery/service_discovery_message_handler.h" |
48 #endif | 48 #endif |
49 | 49 |
50 namespace { | 50 namespace { |
51 | 51 |
52 bool Send(IPC::Message* message) { | 52 bool Send(IPC::Message* message) { |
(...skipping 21 matching lines...) Expand all Loading... |
74 : filter_messages_(false) { | 74 : filter_messages_(false) { |
75 #if !defined(OS_ANDROID) | 75 #if !defined(OS_ANDROID) |
76 handlers_.push_back(new ProfileImportHandler()); | 76 handlers_.push_back(new ProfileImportHandler()); |
77 #endif | 77 #endif |
78 | 78 |
79 #if defined(ENABLE_EXTENSIONS) | 79 #if defined(ENABLE_EXTENSIONS) |
80 handlers_.push_back(new extensions::ExtensionsHandler()); | 80 handlers_.push_back(new extensions::ExtensionsHandler()); |
81 handlers_.push_back(new image_writer::ImageWriterHandler()); | 81 handlers_.push_back(new image_writer::ImageWriterHandler()); |
82 #endif | 82 #endif |
83 | 83 |
84 #if defined(ENABLE_FULL_PRINTING) | 84 #if defined(ENABLE_FULL_PRINTING) || defined(OS_WIN) |
85 handlers_.push_back(new PrintingHandler()); | 85 handlers_.push_back(new PrintingHandler()); |
86 #endif | 86 #endif |
87 | 87 |
88 #if defined(ENABLE_MDNS) | 88 #if defined(ENABLE_MDNS) |
89 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 89 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
90 switches::kUtilityProcessEnableMDns)) { | 90 switches::kUtilityProcessEnableMDns)) { |
91 handlers_.push_back(new local_discovery::ServiceDiscoveryMessageHandler()); | 91 handlers_.push_back(new local_discovery::ServiceDiscoveryMessageHandler()); |
92 } | 92 } |
93 #endif | 93 #endif |
94 | 94 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 return handled; | 154 return handled; |
155 } | 155 } |
156 | 156 |
157 // static | 157 // static |
158 void ChromeContentUtilityClient::PreSandboxStartup() { | 158 void ChromeContentUtilityClient::PreSandboxStartup() { |
159 #if defined(ENABLE_EXTENSIONS) | 159 #if defined(ENABLE_EXTENSIONS) |
160 extensions::ExtensionsHandler::PreSandboxStartup(); | 160 extensions::ExtensionsHandler::PreSandboxStartup(); |
161 #endif | 161 #endif |
162 | 162 |
163 #if defined(ENABLE_FULL_PRINTING) | 163 #if defined(ENABLE_FULL_PRINTING) || defined(OS_WIN) |
164 PrintingHandler::PreSandboxStartup(); | 164 PrintingHandler::PreSandboxStartup(); |
165 #endif | 165 #endif |
166 | 166 |
167 #if defined(ENABLE_MDNS) | 167 #if defined(ENABLE_MDNS) |
168 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 168 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
169 switches::kUtilityProcessEnableMDns)) { | 169 switches::kUtilityProcessEnableMDns)) { |
170 local_discovery::ServiceDiscoveryMessageHandler::PreSandboxStartup(); | 170 local_discovery::ServiceDiscoveryMessageHandler::PreSandboxStartup(); |
171 } | 171 } |
172 #endif // ENABLE_MDNS | 172 #endif // ENABLE_MDNS |
173 } | 173 } |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 const std::string& mime_type, int64 total_size, bool get_attached_images) { | 310 const std::string& mime_type, int64 total_size, bool get_attached_images) { |
311 // Only one IPCDataSource may be created and added to the list of handlers. | 311 // Only one IPCDataSource may be created and added to the list of handlers. |
312 metadata::IPCDataSource* source = new metadata::IPCDataSource(total_size); | 312 metadata::IPCDataSource* source = new metadata::IPCDataSource(total_size); |
313 handlers_.push_back(source); | 313 handlers_.push_back(source); |
314 | 314 |
315 metadata::MediaMetadataParser* parser = new metadata::MediaMetadataParser( | 315 metadata::MediaMetadataParser* parser = new metadata::MediaMetadataParser( |
316 source, mime_type, get_attached_images); | 316 source, mime_type, get_attached_images); |
317 parser->Start(base::Bind(&FinishParseMediaMetadata, base::Owned(parser))); | 317 parser->Start(base::Bind(&FinishParseMediaMetadata, base::Owned(parser))); |
318 } | 318 } |
319 #endif | 319 #endif |
OLD | NEW |