Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: webkit/glue/plugins/plugin_lib_win.cc

Issue 6012002: Move the NPAPI files from webkit/glue/plugins to webkit/plugins/npapi and put... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/glue/plugins/plugin_lib_unittest.cc ('k') | webkit/glue/plugins/plugin_list.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "webkit/glue/plugins/plugin_lib.h"
6
7 #include "base/file_version_info.h"
8 #include "base/file_version_info_win.h"
9 #include "base/logging.h"
10 #include "base/path_service.h"
11 #include "webkit/glue/plugins/plugin_constants_win.h"
12 #include "webkit/glue/plugins/plugin_list.h"
13
14 namespace NPAPI {
15
16 bool PluginLib::ReadWebPluginInfo(const FilePath &filename,
17 WebPluginInfo* info) {
18 // On windows, the way we get the mime types for the library is
19 // to check the version information in the DLL itself. This
20 // will be a string of the format: <type1>|<type2>|<type3>|...
21 // For example:
22 // video/quicktime|audio/aiff|image/jpeg
23 scoped_ptr<FileVersionInfo> version_info(
24 FileVersionInfo::CreateFileVersionInfo(filename.value()));
25 if (!version_info.get()) {
26 LOG_IF(ERROR, PluginList::DebugPluginLoading())
27 << "Could not get version info for plugin "
28 << filename.value();
29 return false;
30 }
31
32 FileVersionInfoWin* version_info_win =
33 static_cast<FileVersionInfoWin*>(version_info.get());
34 PluginVersionInfo pvi;
35 pvi.mime_types = version_info_win->GetStringValue(L"MIMEType");
36 pvi.file_extensions = version_info_win->GetStringValue(L"FileExtents");
37 pvi.type_descriptions = version_info_win->GetStringValue(L"FileOpenName");
38 pvi.product_name = version_info->product_name();
39 pvi.file_description = version_info->file_description();
40 pvi.file_version = version_info->file_version();
41 pvi.path = filename;
42
43 return PluginList::CreateWebPluginInfo(pvi, info);
44 }
45
46 } // namespace NPAPI
OLDNEW
« no previous file with comments | « webkit/glue/plugins/plugin_lib_unittest.cc ('k') | webkit/glue/plugins/plugin_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698