Index: webkit/plugins/npapi/webplugin_delegate_impl_win.cc |
=================================================================== |
--- webkit/plugins/npapi/webplugin_delegate_impl_win.cc (revision 72342) |
+++ webkit/plugins/npapi/webplugin_delegate_impl_win.cc (working copy) |
@@ -181,6 +181,16 @@ |
return std::wstring(info->Name, info->NameLength / sizeof(wchar_t)); |
} |
+int GetPluginMajorVersion(const WebPluginInfo& plugin_info) { |
+ int major_version = 0; |
jam
2011/01/24 22:38:35
i think we want to use PluginGroup::CreateVersionF
|
+ std::vector<std::wstring> version; |
+ base::SplitString(plugin_info.version, L'.', &version); |
+ if (version.size() > 0) { |
+ base::StringToInt(version[0], &major_version); |
+ } |
+ return major_version; |
+} |
+ |
} // namespace |
bool WebPluginDelegateImpl::IsPluginDelegateWindow(HWND window) { |
@@ -290,17 +300,11 @@ |
quirks_ |= PLUGIN_QUIRK_HANDLE_MOUSE_CAPTURE; |
} else if (filename == kAcrobatReaderPlugin) { |
// Check for the version number above or equal 9. |
- std::vector<std::wstring> version; |
- base::SplitString(plugin_info.version, L'.', &version); |
- if (version.size() > 0) { |
- int major; |
- base::StringToInt(version[0], &major); |
- if (major >= 9) { |
- quirks_ |= PLUGIN_QUIRK_DIE_AFTER_UNLOAD; |
- |
- // 9.2 needs this. |
- quirks_ |= PLUGIN_QUIRK_SETWINDOW_TWICE; |
- } |
+ int major_version = GetPluginMajorVersion(plugin_info); |
+ if (major_version >= 9) { |
+ quirks_ |= PLUGIN_QUIRK_DIE_AFTER_UNLOAD; |
+ // 9.2 needs this. |
+ quirks_ |= PLUGIN_QUIRK_SETWINDOW_TWICE; |
} |
quirks_ |= PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS; |
} else if (plugin_info.name.find(L"Windows Media Player") != |
@@ -330,8 +334,11 @@ |
// VLC hangs on NPP_Destroy if we call NPP_SetWindow with a null window |
// handle |
quirks_ |= PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY; |
- // VLC 0.8.6d and 0.8.6e crash if multiple instances are created. |
- quirks_ |= PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES; |
+ int major_version = GetPluginMajorVersion(plugin_info); |
+ if (major_version == 0) { |
+ // VLC 0.8.6d and 0.8.6e crash if multiple instances are created. |
+ quirks_ |= PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES; |
+ } |
} else if (filename == kSilverlightPlugin) { |
// Explanation for this quirk can be found in |
// WebPluginDelegateImpl::Initialize. |