OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 "webkit/plugins/npapi/plugin_lib.h" | 5 #include "webkit/plugins/npapi/plugin_lib.h" |
6 | 6 |
7 #include "base/file_version_info.h" | 7 #include "base/file_version_info.h" |
8 #include "base/file_version_info_win.h" | 8 #include "base/file_version_info_win.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 14 matching lines...) Expand all Loading... | |
25 FileVersionInfo::CreateFileVersionInfo(filename)); | 25 FileVersionInfo::CreateFileVersionInfo(filename)); |
26 if (!version_info.get()) { | 26 if (!version_info.get()) { |
27 LOG_IF(ERROR, PluginList::DebugPluginLoading()) | 27 LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
28 << "Could not get version info for plugin " | 28 << "Could not get version info for plugin " |
29 << filename.value(); | 29 << filename.value(); |
30 return false; | 30 return false; |
31 } | 31 } |
32 | 32 |
33 FileVersionInfoWin* version_info_win = | 33 FileVersionInfoWin* version_info_win = |
34 static_cast<FileVersionInfoWin*>(version_info.get()); | 34 static_cast<FileVersionInfoWin*>(version_info.get()); |
35 PluginVersionInfo pvi; | |
36 pvi.mime_types = version_info_win->GetStringValue(L"MIMEType"); | |
37 pvi.file_extensions = version_info_win->GetStringValue(L"FileExtents"); | |
38 pvi.type_descriptions = version_info_win->GetStringValue(L"FileOpenName"); | |
39 pvi.product_name = version_info->product_name(); | |
40 pvi.file_description = version_info->file_description(); | |
41 pvi.file_version = version_info->file_version(); | |
42 pvi.path = filename; | |
43 | 35 |
44 return PluginList::CreateWebPluginInfo(pvi, info); | 36 info->name = version_info->product_name(); |
37 info->desc = version_info->file_description(); | |
38 info->version = version_info->file_version(); | |
39 info->path = filename; | |
40 info->enabled = true; | |
pastarmovj
2011/01/13 13:36:08
The way you set this flag here is correct.
The en
| |
41 | |
42 // TODO(evan): Move the ParseMimeTypes code inline once Pepper is updated. | |
43 if (!PluginList::ParseMimeTypes( | |
44 version_info_win->GetStringValue(L"MIMEType"), | |
45 version_info_win->GetStringValue(L"FileExtents"), | |
46 version_info_win->GetStringValue(L"FileOpenName"), | |
47 &info->mime_types)) { | |
48 LOG_IF(ERROR, PluginList::DebugPluginLoading()) | |
49 << "Plugin " << info->name << " has bad MIME types, skipping"; | |
50 return false; | |
51 } | |
52 | |
53 return true; | |
45 } | 54 } |
46 | 55 |
47 } // namespace npapi | 56 } // namespace npapi |
48 } // namespace webkit | 57 } // namespace webkit |
OLD | NEW |