| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "chrome/common/chrome_utility_messages.h" | 9 #include "chrome/common/chrome_utility_messages.h" |
| 10 #include "chrome/common/extensions/chrome_extensions_client.h" | 10 #include "chrome/common/extensions/chrome_extensions_client.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } | 62 } |
| 63 | 63 |
| 64 ExtensionsHandler::~ExtensionsHandler() { | 64 ExtensionsHandler::~ExtensionsHandler() { |
| 65 } | 65 } |
| 66 | 66 |
| 67 // static | 67 // static |
| 68 void ExtensionsHandler::PreSandboxStartup() { | 68 void ExtensionsHandler::PreSandboxStartup() { |
| 69 // Initialize libexif for image metadata parsing. | 69 // Initialize libexif for image metadata parsing. |
| 70 metadata::ImageMetadataExtractor::InitializeLibrary(); | 70 metadata::ImageMetadataExtractor::InitializeLibrary(); |
| 71 | 71 |
| 72 // Load media libraries for media file validation. | 72 // Initialize media libraries for media file validation. |
| 73 base::FilePath media_path; | 73 media::InitializeMediaLibrary(); |
| 74 PathService::Get(content::DIR_MEDIA_LIBS, &media_path); | |
| 75 if (!media_path.empty()) | |
| 76 media::InitializeMediaLibrary(media_path); | |
| 77 } | 74 } |
| 78 | 75 |
| 79 bool ExtensionsHandler::OnMessageReceived(const IPC::Message& message) { | 76 bool ExtensionsHandler::OnMessageReceived(const IPC::Message& message) { |
| 80 bool handled = true; | 77 bool handled = true; |
| 81 IPC_BEGIN_MESSAGE_MAP(ExtensionsHandler, message) | 78 IPC_BEGIN_MESSAGE_MAP(ExtensionsHandler, message) |
| 82 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_UnzipToDir, OnUnzipToDir) | 79 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_UnzipToDir, OnUnzipToDir) |
| 83 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_CheckMediaFile, OnCheckMediaFile) | 80 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_CheckMediaFile, OnCheckMediaFile) |
| 84 #if defined(OS_WIN) | 81 #if defined(OS_WIN) |
| 85 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_ParseITunesPrefXml, | 82 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_ParseITunesPrefXml, |
| 86 OnParseITunesPrefXml) | 83 OnParseITunesPrefXml) |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 205 |
| 209 std::string key_data; | 206 std::string key_data; |
| 210 std::string error; | 207 std::string error; |
| 211 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); | 208 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); |
| 212 | 209 |
| 213 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); | 210 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); |
| 214 } | 211 } |
| 215 #endif // defined(OS_WIN) | 212 #endif // defined(OS_WIN) |
| 216 | 213 |
| 217 } // namespace extensions | 214 } // namespace extensions |
| OLD | NEW |