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" | |
28 #include "chrome/utility/profile_import_handler.h" | 27 #include "chrome/utility/profile_import_handler.h" |
29 #include "chrome/utility/web_resource_unpacker.h" | 28 #include "chrome/utility/web_resource_unpacker.h" |
30 #include "content/public/child/image_decoder_utils.h" | 29 #include "content/public/child/image_decoder_utils.h" |
31 #include "content/public/common/content_paths.h" | 30 #include "content/public/common/content_paths.h" |
32 #include "content/public/common/content_switches.h" | 31 #include "content/public/common/content_switches.h" |
33 #include "content/public/utility/utility_thread.h" | 32 #include "content/public/utility/utility_thread.h" |
34 #include "extensions/common/extension.h" | 33 #include "extensions/common/extension.h" |
35 #include "extensions/common/manifest.h" | 34 #include "extensions/common/manifest.h" |
36 #include "media/base/media.h" | 35 #include "media/base/media.h" |
37 #include "media/base/media_file_checker.h" | 36 #include "media/base/media_file_checker.h" |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 #if !defined(OS_ANDROID) | 311 #if !defined(OS_ANDROID) |
313 handlers_.push_back(new ProfileImportHandler()); | 312 handlers_.push_back(new ProfileImportHandler()); |
314 #endif // OS_ANDROID | 313 #endif // OS_ANDROID |
315 | 314 |
316 #if defined(ENABLE_MDNS) | 315 #if defined(ENABLE_MDNS) |
317 if (CommandLine::ForCurrentProcess()->HasSwitch( | 316 if (CommandLine::ForCurrentProcess()->HasSwitch( |
318 switches::kUtilityProcessEnableMDns)) { | 317 switches::kUtilityProcessEnableMDns)) { |
319 handlers_.push_back(new local_discovery::ServiceDiscoveryMessageHandler()); | 318 handlers_.push_back(new local_discovery::ServiceDiscoveryMessageHandler()); |
320 } | 319 } |
321 #endif // ENABLE_MDNS | 320 #endif // ENABLE_MDNS |
322 | |
323 handlers_.push_back(new image_writer::ImageWriterHandler()); | |
324 } | 321 } |
325 | 322 |
326 ChromeContentUtilityClient::~ChromeContentUtilityClient() { | 323 ChromeContentUtilityClient::~ChromeContentUtilityClient() { |
327 } | 324 } |
328 | 325 |
329 void ChromeContentUtilityClient::UtilityThreadStarted() { | 326 void ChromeContentUtilityClient::UtilityThreadStarted() { |
330 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 327 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
331 std::string lang = command_line->GetSwitchValueASCII(switches::kLang); | 328 std::string lang = command_line->GetSwitchValueASCII(switches::kLang); |
332 if (!lang.empty()) | 329 if (!lang.empty()) |
333 extension_l10n_util::SetProcessLocale(lang); | 330 extension_l10n_util::SetProcessLocale(lang); |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 picasa::PicasaAlbumsIndexer indexer(album_uids); | 893 picasa::PicasaAlbumsIndexer indexer(album_uids); |
897 indexer.ParseFolderINI(folders_inis); | 894 indexer.ParseFolderINI(folders_inis); |
898 | 895 |
899 Send(new ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished( | 896 Send(new ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished( |
900 indexer.albums_images())); | 897 indexer.albums_images())); |
901 ReleaseProcessIfNeeded(); | 898 ReleaseProcessIfNeeded(); |
902 } | 899 } |
903 #endif // defined(OS_WIN) || defined(OS_MACOSX) | 900 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
904 | 901 |
905 } // namespace chrome | 902 } // namespace chrome |
OLD | NEW |