| 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/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/message_loop_proxy.h" | 13 #include "base/message_loop_proxy.h" |
| 14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 15 #include "chrome/browser/importer/importer.h" | 15 #include "chrome/browser/importer/importer.h" |
| 16 #include "chrome/browser/importer/profile_import_process_messages.h" | 16 #include "chrome/browser/importer/profile_import_process_messages.h" |
| 17 #include "chrome/common/child_process_logging.h" | 17 #include "chrome/common/child_process_logging.h" |
| 18 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
| 19 #include "chrome/common/chrome_utility_messages.h" | 19 #include "chrome/common/chrome_utility_messages.h" |
| 20 #include "chrome/common/extensions/api/extension_action/browser_action_handler.h
" | 20 #include "chrome/common/extensions/api/extension_action/browser_action_handler.h
" |
| 21 #include "chrome/common/extensions/api/extension_action/page_action_handler.h" | 21 #include "chrome/common/extensions/api/extension_action/page_action_handler.h" |
| 22 #include "chrome/common/extensions/api/i18n/default_locale_handler.h" | 22 #include "chrome/common/extensions/api/i18n/default_locale_handler.h" |
| 23 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 23 #include "chrome/common/extensions/api/themes/theme_handler.h" | 24 #include "chrome/common/extensions/api/themes/theme_handler.h" |
| 24 #include "chrome/common/extensions/extension.h" | 25 #include "chrome/common/extensions/extension.h" |
| 25 #include "chrome/common/extensions/extension_l10n_util.h" | 26 #include "chrome/common/extensions/extension_l10n_util.h" |
| 26 #include "chrome/common/extensions/extension_manifest_constants.h" | 27 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 27 #include "chrome/common/extensions/manifest.h" | 28 #include "chrome/common/extensions/manifest.h" |
| 28 #include "chrome/common/extensions/manifest_handler.h" | 29 #include "chrome/common/extensions/manifest_handler.h" |
| 29 #include "chrome/common/extensions/unpacker.h" | 30 #include "chrome/common/extensions/unpacker.h" |
| 30 #include "chrome/common/extensions/update_manifest.h" | 31 #include "chrome/common/extensions/update_manifest.h" |
| 31 #include "chrome/common/safe_browsing/zip_analyzer.h" | 32 #include "chrome/common/safe_browsing/zip_analyzer.h" |
| 32 #include "chrome/common/web_resource/web_resource_unpacker.h" | 33 #include "chrome/common/web_resource/web_resource_unpacker.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 53 namespace { | 54 namespace { |
| 54 | 55 |
| 55 // Explicitly register all ManifestHandlers needed in the utility process. | 56 // Explicitly register all ManifestHandlers needed in the utility process. |
| 56 void RegisterExtensionManifestHandlers() { | 57 void RegisterExtensionManifestHandlers() { |
| 57 extensions::ManifestHandler::Register( | 58 extensions::ManifestHandler::Register( |
| 58 extension_manifest_keys::kBrowserAction, | 59 extension_manifest_keys::kBrowserAction, |
| 59 make_linked_ptr(new extensions::BrowserActionHandler)); | 60 make_linked_ptr(new extensions::BrowserActionHandler)); |
| 60 extensions::ManifestHandler::Register( | 61 extensions::ManifestHandler::Register( |
| 61 extension_manifest_keys::kDefaultLocale, | 62 extension_manifest_keys::kDefaultLocale, |
| 62 make_linked_ptr(new extensions::DefaultLocaleHandler)); | 63 make_linked_ptr(new extensions::DefaultLocaleHandler)); |
| 64 extensions::ManifestHandler::Register( |
| 65 extension_manifest_keys::kIcons, |
| 66 make_linked_ptr(new extensions::IconsHandler)); |
| 63 linked_ptr<extensions::PageActionHandler> page_action_handler( | 67 linked_ptr<extensions::PageActionHandler> page_action_handler( |
| 64 new extensions::PageActionHandler); | 68 new extensions::PageActionHandler); |
| 65 extensions::ManifestHandler::Register( | 69 extensions::ManifestHandler::Register( |
| 66 extension_manifest_keys::kPageAction, page_action_handler); | 70 extension_manifest_keys::kPageAction, page_action_handler); |
| 67 extensions::ManifestHandler::Register( | 71 extensions::ManifestHandler::Register( |
| 68 extension_manifest_keys::kPageActions, page_action_handler); | 72 extension_manifest_keys::kPageActions, page_action_handler); |
| 69 extensions::ManifestHandler::Register( | 73 extensions::ManifestHandler::Register( |
| 70 extension_manifest_keys::kTheme, | 74 extension_manifest_keys::kTheme, |
| 71 make_linked_ptr(new extensions::ThemeHandler)); | 75 make_linked_ptr(new extensions::ThemeHandler)); |
| 72 } | 76 } |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 IPC::PlatformFileForTransit zip_file) { | 496 IPC::PlatformFileForTransit zip_file) { |
| 493 safe_browsing::zip_analyzer::Results results; | 497 safe_browsing::zip_analyzer::Results results; |
| 494 safe_browsing::zip_analyzer::AnalyzeZipFile( | 498 safe_browsing::zip_analyzer::AnalyzeZipFile( |
| 495 IPC::PlatformFileForTransitToPlatformFile(zip_file), &results); | 499 IPC::PlatformFileForTransitToPlatformFile(zip_file), &results); |
| 496 Send(new ChromeUtilityHostMsg_AnalyzeZipFileForDownloadProtection_Finished( | 500 Send(new ChromeUtilityHostMsg_AnalyzeZipFileForDownloadProtection_Finished( |
| 497 results)); | 501 results)); |
| 498 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); | 502 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); |
| 499 } | 503 } |
| 500 | 504 |
| 501 } // namespace chrome | 505 } // namespace chrome |
| OLD | NEW |