| 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/themes/theme_handler.h" | 23 #include "chrome/common/extensions/api/themes/theme_handler.h" |
| 24 #include "chrome/common/extensions/background_info.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/web_resource/web_resource_unpacker.h" | 32 #include "chrome/common/web_resource/web_resource_unpacker.h" |
| 32 #include "chrome/common/zip.h" | 33 #include "chrome/common/zip.h" |
| 33 #include "chrome/utility/profile_import_handler.h" | 34 #include "chrome/utility/profile_import_handler.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 46 #include "base/win/scoped_handle.h" | 47 #include "base/win/scoped_handle.h" |
| 47 #include "content/public/common/content_switches.h" | 48 #include "content/public/common/content_switches.h" |
| 48 #include "printing/emf_win.h" | 49 #include "printing/emf_win.h" |
| 49 #include "ui/gfx/gdi_util.h" | 50 #include "ui/gfx/gdi_util.h" |
| 50 #endif // defined(OS_WIN) | 51 #endif // defined(OS_WIN) |
| 51 | 52 |
| 52 namespace { | 53 namespace { |
| 53 | 54 |
| 54 // Explicitly register all ManifestHandlers needed in the utility process. | 55 // Explicitly register all ManifestHandlers needed in the utility process. |
| 55 void RegisterExtensionManifestHandlers() { | 56 void RegisterExtensionManifestHandlers() { |
| 57 std::vector<std::string> background_keys( |
| 58 extensions::BackgroundManifestHandler::keys()); |
| 59 linked_ptr<extensions::BackgroundManifestHandler> background_handler( |
| 60 new extensions::BackgroundManifestHandler); |
| 61 for (size_t i = 0; i < background_keys.size(); ++i) { |
| 62 extensions::ManifestHandler::Register(background_keys[i], |
| 63 background_handler); |
| 64 } |
| 56 extensions::ManifestHandler::Register( | 65 extensions::ManifestHandler::Register( |
| 57 extension_manifest_keys::kBrowserAction, | 66 extension_manifest_keys::kBrowserAction, |
| 58 make_linked_ptr(new extensions::BrowserActionHandler)); | 67 make_linked_ptr(new extensions::BrowserActionHandler)); |
| 59 extensions::ManifestHandler::Register( | 68 extensions::ManifestHandler::Register( |
| 60 extension_manifest_keys::kDefaultLocale, | 69 extension_manifest_keys::kDefaultLocale, |
| 61 make_linked_ptr(new extensions::DefaultLocaleHandler)); | 70 make_linked_ptr(new extensions::DefaultLocaleHandler)); |
| 62 linked_ptr<extensions::PageActionHandler> page_action_handler( | 71 linked_ptr<extensions::PageActionHandler> page_action_handler( |
| 63 new extensions::PageActionHandler); | 72 new extensions::PageActionHandler); |
| 64 extensions::ManifestHandler::Register( | 73 extensions::ManifestHandler::Register( |
| 65 extension_manifest_keys::kPageAction, page_action_handler); | 74 extension_manifest_keys::kPageAction, page_action_handler); |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 } else | 482 } else |
| 474 #endif | 483 #endif |
| 475 { | 484 { |
| 476 Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed( | 485 Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed( |
| 477 printer_name)); | 486 printer_name)); |
| 478 } | 487 } |
| 479 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); | 488 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); |
| 480 } | 489 } |
| 481 | 490 |
| 482 } // namespace chrome | 491 } // namespace chrome |
| OLD | NEW |