OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/extensions_handler.h" | 5 #include "chrome/utility/extensions/extensions_handler.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "chrome/common/chrome_utility_messages.h" | 12 #include "chrome/common/chrome_utility_messages.h" |
13 #include "chrome/common/extensions/chrome_extensions_client.h" | 13 #include "chrome/common/extensions/chrome_extensions_client.h" |
14 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" | 14 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" |
15 #include "chrome/common/media_galleries/metadata_types.h" | 15 #include "chrome/common/media_galleries/metadata_types.h" |
16 #include "chrome/utility/chrome_content_utility_client.h" | 16 #include "chrome/utility/chrome_content_utility_client.h" |
| 17 #include "chrome/utility/media_galleries/image_metadata_extractor.h" |
17 #include "chrome/utility/media_galleries/ipc_data_source.h" | 18 #include "chrome/utility/media_galleries/ipc_data_source.h" |
18 #include "chrome/utility/media_galleries/media_metadata_parser.h" | 19 #include "chrome/utility/media_galleries/media_metadata_parser.h" |
19 #include "content/public/common/content_paths.h" | 20 #include "content/public/common/content_paths.h" |
20 #include "content/public/utility/utility_thread.h" | 21 #include "content/public/utility/utility_thread.h" |
21 #include "extensions/common/extension.h" | 22 #include "extensions/common/extension.h" |
22 #include "extensions/common/extension_l10n_util.h" | 23 #include "extensions/common/extension_l10n_util.h" |
23 #include "extensions/common/extension_utility_messages.h" | 24 #include "extensions/common/extension_utility_messages.h" |
24 #include "extensions/utility/unpacker.h" | 25 #include "extensions/utility/unpacker.h" |
25 #include "media/base/media.h" | 26 #include "media/base/media.h" |
26 #include "ui/base/ui_base_switches.h" | 27 #include "ui/base/ui_base_switches.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 ExtensionsHandler::ExtensionsHandler(ChromeContentUtilityClient* utility_client) | 73 ExtensionsHandler::ExtensionsHandler(ChromeContentUtilityClient* utility_client) |
73 : utility_client_(utility_client) { | 74 : utility_client_(utility_client) { |
74 ExtensionsClient::Set(ChromeExtensionsClient::GetInstance()); | 75 ExtensionsClient::Set(ChromeExtensionsClient::GetInstance()); |
75 } | 76 } |
76 | 77 |
77 ExtensionsHandler::~ExtensionsHandler() { | 78 ExtensionsHandler::~ExtensionsHandler() { |
78 } | 79 } |
79 | 80 |
80 // static | 81 // static |
81 void ExtensionsHandler::PreSandboxStartup() { | 82 void ExtensionsHandler::PreSandboxStartup() { |
| 83 // Initialize libexif for image metadata parsing. |
| 84 metadata::ImageMetadataExtractor::InitializeLibrary(); |
| 85 |
82 // Initialize media libraries for media file validation. | 86 // Initialize media libraries for media file validation. |
83 media::InitializeMediaLibrary(); | 87 media::InitializeMediaLibrary(); |
84 } | 88 } |
85 | 89 |
86 bool ExtensionsHandler::OnMessageReceived(const IPC::Message& message) { | 90 bool ExtensionsHandler::OnMessageReceived(const IPC::Message& message) { |
87 bool handled = true; | 91 bool handled = true; |
88 IPC_BEGIN_MESSAGE_MAP(ExtensionsHandler, message) | 92 IPC_BEGIN_MESSAGE_MAP(ExtensionsHandler, message) |
89 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_CheckMediaFile, OnCheckMediaFile) | 93 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_CheckMediaFile, OnCheckMediaFile) |
90 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_ParseMediaMetadata, | 94 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_ParseMediaMetadata, |
91 OnParseMediaMetadata) | 95 OnParseMediaMetadata) |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 225 |
222 std::string key_data; | 226 std::string key_data; |
223 std::string error; | 227 std::string error; |
224 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); | 228 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); |
225 | 229 |
226 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); | 230 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); |
227 } | 231 } |
228 #endif // defined(OS_WIN) | 232 #endif // defined(OS_WIN) |
229 | 233 |
230 } // namespace extensions | 234 } // namespace extensions |
OLD | NEW |