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/base64.h" | 7 #include "base/base64.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/scoped_native_library.h" | 15 #include "base/scoped_native_library.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 #include "chrome/common/chrome_paths.h" | 17 #include "chrome/common/chrome_paths.h" |
18 #include "chrome/common/chrome_utility_messages.h" | 18 #include "chrome/common/chrome_utility_messages.h" |
19 #include "chrome/common/extensions/chrome_extensions_client.h" | 19 #include "chrome/common/extensions/chrome_extensions_client.h" |
20 #include "chrome/common/extensions/extension_l10n_util.h" | 20 #include "chrome/common/extensions/extension_l10n_util.h" |
21 #include "chrome/common/extensions/update_manifest.h" | 21 #include "chrome/common/extensions/update_manifest.h" |
22 #include "chrome/common/safe_browsing/zip_analyzer.h" | 22 #include "chrome/common/safe_browsing/zip_analyzer.h" |
23 #include "chrome/utility/chrome_content_utility_ipc_whitelist.h" | 23 #include "chrome/utility/chrome_content_utility_ipc_whitelist.h" |
24 #include "chrome/utility/cloud_print/bitmap_image.h" | 24 #include "chrome/utility/cloud_print/bitmap_image.h" |
25 #include "chrome/utility/cloud_print/pwg_encoder.h" | 25 #include "chrome/utility/cloud_print/pwg_encoder.h" |
26 #include "chrome/utility/extensions/unpacker.h" | 26 #include "chrome/utility/extensions/unpacker.h" |
| 27 #include "chrome/utility/image_writer/image_writer_handler.h" |
27 #include "chrome/utility/profile_import_handler.h" | 28 #include "chrome/utility/profile_import_handler.h" |
28 #include "chrome/utility/web_resource_unpacker.h" | 29 #include "chrome/utility/web_resource_unpacker.h" |
29 #include "content/public/child/image_decoder_utils.h" | 30 #include "content/public/child/image_decoder_utils.h" |
30 #include "content/public/common/content_paths.h" | 31 #include "content/public/common/content_paths.h" |
31 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
32 #include "content/public/utility/utility_thread.h" | 33 #include "content/public/utility/utility_thread.h" |
33 #include "extensions/common/extension.h" | 34 #include "extensions/common/extension.h" |
34 #include "extensions/common/manifest.h" | 35 #include "extensions/common/manifest.h" |
35 #include "media/base/media.h" | 36 #include "media/base/media.h" |
36 #include "media/base/media_file_checker.h" | 37 #include "media/base/media_file_checker.h" |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 #if !defined(OS_ANDROID) | 312 #if !defined(OS_ANDROID) |
312 handlers_.push_back(new ProfileImportHandler()); | 313 handlers_.push_back(new ProfileImportHandler()); |
313 #endif // OS_ANDROID | 314 #endif // OS_ANDROID |
314 | 315 |
315 #if defined(ENABLE_MDNS) | 316 #if defined(ENABLE_MDNS) |
316 if (CommandLine::ForCurrentProcess()->HasSwitch( | 317 if (CommandLine::ForCurrentProcess()->HasSwitch( |
317 switches::kUtilityProcessEnableMDns)) { | 318 switches::kUtilityProcessEnableMDns)) { |
318 handlers_.push_back(new local_discovery::ServiceDiscoveryMessageHandler()); | 319 handlers_.push_back(new local_discovery::ServiceDiscoveryMessageHandler()); |
319 } | 320 } |
320 #endif // ENABLE_MDNS | 321 #endif // ENABLE_MDNS |
| 322 |
| 323 handlers_.push_back(new image_writer::ImageWriterHandler()); |
321 } | 324 } |
322 | 325 |
323 ChromeContentUtilityClient::~ChromeContentUtilityClient() { | 326 ChromeContentUtilityClient::~ChromeContentUtilityClient() { |
324 } | 327 } |
325 | 328 |
326 void ChromeContentUtilityClient::UtilityThreadStarted() { | 329 void ChromeContentUtilityClient::UtilityThreadStarted() { |
327 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 330 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
328 std::string lang = command_line->GetSwitchValueASCII(switches::kLang); | 331 std::string lang = command_line->GetSwitchValueASCII(switches::kLang); |
329 if (!lang.empty()) | 332 if (!lang.empty()) |
330 extension_l10n_util::SetProcessLocale(lang); | 333 extension_l10n_util::SetProcessLocale(lang); |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 picasa::PicasaAlbumsIndexer indexer(album_uids); | 896 picasa::PicasaAlbumsIndexer indexer(album_uids); |
894 indexer.ParseFolderINI(folders_inis); | 897 indexer.ParseFolderINI(folders_inis); |
895 | 898 |
896 Send(new ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished( | 899 Send(new ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished( |
897 indexer.albums_images())); | 900 indexer.albums_images())); |
898 ReleaseProcessIfNeeded(); | 901 ReleaseProcessIfNeeded(); |
899 } | 902 } |
900 #endif // defined(OS_WIN) || defined(OS_MACOSX) | 903 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
901 | 904 |
902 } // namespace chrome | 905 } // namespace chrome |
OLD | NEW |