From c85b0ba71b5a55647b01de9d345e46896979033d Mon Sep 17 00:00:00 2001 From: "chase@chromium.org" Date: Tue, 21 Dec 2010 00:23:26 +0000 Subject: Revert "Move the NPAPI files from webkit/glue/plugins to webkit/plugins/npapi" Manually reverting r69755, which broke the tree. BUG=none TEST=none TBR=dmaclach@chromium.org Review URL: http://codereview.chromium.org/5998002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69771 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/plugins/plugin_lib_win.cc | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 webkit/glue/plugins/plugin_lib_win.cc (limited to 'webkit/glue/plugins/plugin_lib_win.cc') diff --git a/webkit/glue/plugins/plugin_lib_win.cc b/webkit/glue/plugins/plugin_lib_win.cc new file mode 100644 index 0000000..382c2c8 --- /dev/null +++ b/webkit/glue/plugins/plugin_lib_win.cc @@ -0,0 +1,46 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "webkit/glue/plugins/plugin_lib.h" + +#include "base/file_version_info.h" +#include "base/file_version_info_win.h" +#include "base/logging.h" +#include "base/path_service.h" +#include "webkit/glue/plugins/plugin_constants_win.h" +#include "webkit/glue/plugins/plugin_list.h" + +namespace NPAPI { + +bool PluginLib::ReadWebPluginInfo(const FilePath &filename, + WebPluginInfo* info) { + // On windows, the way we get the mime types for the library is + // to check the version information in the DLL itself. This + // will be a string of the format: |||... + // For example: + // video/quicktime|audio/aiff|image/jpeg + scoped_ptr version_info( + FileVersionInfo::CreateFileVersionInfo(filename.value())); + if (!version_info.get()) { + LOG_IF(ERROR, PluginList::DebugPluginLoading()) + << "Could not get version info for plugin " + << filename.value(); + return false; + } + + FileVersionInfoWin* version_info_win = + static_cast(version_info.get()); + PluginVersionInfo pvi; + pvi.mime_types = version_info_win->GetStringValue(L"MIMEType"); + pvi.file_extensions = version_info_win->GetStringValue(L"FileExtents"); + pvi.type_descriptions = version_info_win->GetStringValue(L"FileOpenName"); + pvi.product_name = version_info->product_name(); + pvi.file_description = version_info->file_description(); + pvi.file_version = version_info->file_version(); + pvi.path = filename; + + return PluginList::CreateWebPluginInfo(pvi, info); +} + +} // namespace NPAPI -- cgit v1.1