diff options
author | chase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-21 00:23:26 +0000 |
---|---|---|
committer | chase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-21 00:23:26 +0000 |
commit | c85b0ba71b5a55647b01de9d345e46896979033d (patch) | |
tree | ae99657ca1440b7540da473e1bbe6156e43e9be3 /webkit/glue/plugins/plugin_lib_win.cc | |
parent | 887ba3adc7b32b7df315ef292ae9395fd75653e5 (diff) | |
download | chromium_src-c85b0ba71b5a55647b01de9d345e46896979033d.zip chromium_src-c85b0ba71b5a55647b01de9d345e46896979033d.tar.gz chromium_src-c85b0ba71b5a55647b01de9d345e46896979033d.tar.bz2 |
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
Diffstat (limited to 'webkit/glue/plugins/plugin_lib_win.cc')
-rw-r--r-- | webkit/glue/plugins/plugin_lib_win.cc | 46 |
1 files changed, 46 insertions, 0 deletions
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: <type1>|<type2>|<type3>|... + // For example: + // video/quicktime|audio/aiff|image/jpeg + scoped_ptr<FileVersionInfo> 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<FileVersionInfoWin*>(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 |