| 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/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "chrome/common/chrome_utility_messages.h" | 16 #include "chrome/common/chrome_utility_messages.h" |
| 17 #include "chrome/common/extensions/chrome_extensions_client.h" | 17 #include "chrome/common/extensions/chrome_extensions_client.h" |
| 18 #include "chrome/common/extensions/extension.h" | 18 #include "chrome/common/extensions/extension.h" |
| 19 #include "chrome/common/extensions/extension_l10n_util.h" | 19 #include "chrome/common/extensions/extension_l10n_util.h" |
| 20 #include "chrome/common/extensions/update_manifest.h" | 20 #include "chrome/common/extensions/update_manifest.h" |
| 21 #include "chrome/common/safe_browsing/zip_analyzer.h" | 21 #include "chrome/common/safe_browsing/zip_analyzer.h" |
| 22 #include "chrome/utility/extensions/unpacker.h" | 22 #include "chrome/utility/extensions/unpacker.h" |
| 23 #include "chrome/utility/image_writer/image_writer_handler.h" |
| 23 #include "chrome/utility/profile_import_handler.h" | 24 #include "chrome/utility/profile_import_handler.h" |
| 24 #include "chrome/utility/web_resource_unpacker.h" | 25 #include "chrome/utility/web_resource_unpacker.h" |
| 25 #include "content/public/child/image_decoder_utils.h" | 26 #include "content/public/child/image_decoder_utils.h" |
| 26 #include "content/public/common/content_paths.h" | 27 #include "content/public/common/content_paths.h" |
| 27 #include "content/public/utility/utility_thread.h" | 28 #include "content/public/utility/utility_thread.h" |
| 28 #include "extensions/common/manifest.h" | 29 #include "extensions/common/manifest.h" |
| 29 #include "media/base/media.h" | 30 #include "media/base/media.h" |
| 30 #include "media/base/media_file_checker.h" | 31 #include "media/base/media_file_checker.h" |
| 31 #include "printing/page_range.h" | 32 #include "printing/page_range.h" |
| 32 #include "third_party/skia/include/core/SkBitmap.h" | 33 #include "third_party/skia/include/core/SkBitmap.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 #if !defined(OS_ANDROID) | 87 #if !defined(OS_ANDROID) |
| 87 handlers_.push_back(new ProfileImportHandler()); | 88 handlers_.push_back(new ProfileImportHandler()); |
| 88 #endif // OS_ANDROID | 89 #endif // OS_ANDROID |
| 89 | 90 |
| 90 #if defined(ENABLE_MDNS) | 91 #if defined(ENABLE_MDNS) |
| 91 if (CommandLine::ForCurrentProcess()->HasSwitch( | 92 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 92 switches::kUtilityProcessEnableMDns)) { | 93 switches::kUtilityProcessEnableMDns)) { |
| 93 handlers_.push_back(new local_discovery::ServiceDiscoveryMessageHandler()); | 94 handlers_.push_back(new local_discovery::ServiceDiscoveryMessageHandler()); |
| 94 } | 95 } |
| 95 #endif // ENABLE_MDNS | 96 #endif // ENABLE_MDNS |
| 97 |
| 98 handlers_.push_back(new image_writer::ImageWriterHandler()); |
| 96 } | 99 } |
| 97 | 100 |
| 98 ChromeContentUtilityClient::~ChromeContentUtilityClient() { | 101 ChromeContentUtilityClient::~ChromeContentUtilityClient() { |
| 99 } | 102 } |
| 100 | 103 |
| 101 void ChromeContentUtilityClient::UtilityThreadStarted() { | 104 void ChromeContentUtilityClient::UtilityThreadStarted() { |
| 102 #if defined(OS_WIN) | 105 #if defined(OS_WIN) |
| 103 // Load the pdf plugin before the sandbox is turned on. This is for Windows | 106 // Load the pdf plugin before the sandbox is turned on. This is for Windows |
| 104 // only because we need this DLL only on Windows. | 107 // only because we need this DLL only on Windows. |
| 105 base::FilePath pdf; | 108 base::FilePath pdf; |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 picasa::PicasaAlbumsIndexer indexer(album_uids); | 626 picasa::PicasaAlbumsIndexer indexer(album_uids); |
| 624 indexer.ParseFolderINI(folders_inis); | 627 indexer.ParseFolderINI(folders_inis); |
| 625 | 628 |
| 626 Send(new ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished( | 629 Send(new ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished( |
| 627 indexer.albums_images())); | 630 indexer.albums_images())); |
| 628 ReleaseProcessIfNeeded(); | 631 ReleaseProcessIfNeeded(); |
| 629 } | 632 } |
| 630 #endif // defined(OS_WIN) || defined(OS_MACOSX) | 633 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
| 631 | 634 |
| 632 } // namespace chrome | 635 } // namespace chrome |
| OLD | NEW |