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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 | 59 |
60 ExtensionsHandler::~ExtensionsHandler() { | 60 ExtensionsHandler::~ExtensionsHandler() { |
61 } | 61 } |
62 | 62 |
63 // static | 63 // static |
64 void ExtensionsHandler::PreSandboxStartup() { | 64 void ExtensionsHandler::PreSandboxStartup() { |
65 // Initialize libexif for image metadata parsing. | 65 // Initialize libexif for image metadata parsing. |
66 metadata::ImageMetadataExtractor::InitializeLibrary(); | 66 metadata::ImageMetadataExtractor::InitializeLibrary(); |
67 | 67 |
68 // Initialize media libraries for media file validation. | 68 // Load media libraries for media file validation. |
69 media::InitializeMediaLibrary(); | 69 base::FilePath media_path; |
| 70 PathService::Get(content::DIR_MEDIA_LIBS, &media_path); |
| 71 if (!media_path.empty()) |
| 72 media::InitializeMediaLibrary(media_path); |
70 } | 73 } |
71 | 74 |
72 bool ExtensionsHandler::OnMessageReceived(const IPC::Message& message) { | 75 bool ExtensionsHandler::OnMessageReceived(const IPC::Message& message) { |
73 bool handled = true; | 76 bool handled = true; |
74 IPC_BEGIN_MESSAGE_MAP(ExtensionsHandler, message) | 77 IPC_BEGIN_MESSAGE_MAP(ExtensionsHandler, message) |
75 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_CheckMediaFile, OnCheckMediaFile) | 78 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_CheckMediaFile, OnCheckMediaFile) |
76 #if defined(OS_WIN) | 79 #if defined(OS_WIN) |
77 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_ParseITunesPrefXml, | 80 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_ParseITunesPrefXml, |
78 OnParseITunesPrefXml) | 81 OnParseITunesPrefXml) |
79 #endif // defined(OS_WIN) | 82 #endif // defined(OS_WIN) |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 191 |
189 std::string key_data; | 192 std::string key_data; |
190 std::string error; | 193 std::string error; |
191 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); | 194 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); |
192 | 195 |
193 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); | 196 Send(new ChromeUtilityHostMsg_GotWiFiCredentials(key_data, error.empty())); |
194 } | 197 } |
195 #endif // defined(OS_WIN) | 198 #endif // defined(OS_WIN) |
196 | 199 |
197 } // namespace extensions | 200 } // namespace extensions |
OLD | NEW |