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