OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/child/npapi/webplugin_delegate_impl.h" | 5 #include "content/child/npapi/webplugin_delegate_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
180 | 180 |
181 result = func(key, KeyNameInformation, buffer.get(), size, &size); | 181 result = func(key, KeyNameInformation, buffer.get(), size, &size); |
182 if (result != STATUS_SUCCESS) | 182 if (result != STATUS_SUCCESS) |
183 return L""; | 183 return L""; |
184 | 184 |
185 KEY_NAME_INFORMATION* info = | 185 KEY_NAME_INFORMATION* info = |
186 reinterpret_cast<KEY_NAME_INFORMATION*>(buffer.get()); | 186 reinterpret_cast<KEY_NAME_INFORMATION*>(buffer.get()); |
187 return std::wstring(info->Name, info->NameLength / sizeof(wchar_t)); | 187 return std::wstring(info->Name, info->NameLength / sizeof(wchar_t)); |
188 } | 188 } |
189 | 189 |
190 int GetPluginMajorVersion(const WebPluginInfo& plugin_info) { | 190 unsigned int GetPluginMajorVersion(const WebPluginInfo& plugin_info) { |
Nico
2015/03/09 14:21:57
uint32_t?
Will Harris
2015/03/09 22:52:18
Done.
| |
191 Version plugin_version; | 191 Version plugin_version; |
192 WebPluginInfo::CreateVersionFromString(plugin_info.version, &plugin_version); | 192 WebPluginInfo::CreateVersionFromString(plugin_info.version, &plugin_version); |
193 | 193 |
194 int major_version = 0; | 194 unsigned int major_version = 0; |
195 if (plugin_version.IsValid()) | 195 if (plugin_version.IsValid()) |
196 major_version = plugin_version.components()[0]; | 196 major_version = plugin_version.components()[0]; |
197 | 197 |
198 return major_version; | 198 return major_version; |
199 } | 199 } |
200 | 200 |
201 } // namespace | 201 } // namespace |
202 | 202 |
203 LRESULT CALLBACK WebPluginDelegateImpl::HandleEventMessageFilterHook( | 203 LRESULT CALLBACK WebPluginDelegateImpl::HandleEventMessageFilterHook( |
204 int code, WPARAM wParam, LPARAM lParam) { | 204 int code, WPARAM wParam, LPARAM lParam) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
259 // agent. | 259 // agent. |
260 instance_->set_use_mozilla_user_agent(); | 260 instance_->set_use_mozilla_user_agent(); |
261 quirks_ |= PLUGIN_QUIRK_THROTTLE_WM_USER_PLUS_ONE; | 261 quirks_ |= PLUGIN_QUIRK_THROTTLE_WM_USER_PLUS_ONE; |
262 quirks_ |= PLUGIN_QUIRK_PATCH_SETCURSOR; | 262 quirks_ |= PLUGIN_QUIRK_PATCH_SETCURSOR; |
263 quirks_ |= PLUGIN_QUIRK_ALWAYS_NOTIFY_SUCCESS; | 263 quirks_ |= PLUGIN_QUIRK_ALWAYS_NOTIFY_SUCCESS; |
264 quirks_ |= PLUGIN_QUIRK_HANDLE_MOUSE_CAPTURE; | 264 quirks_ |= PLUGIN_QUIRK_HANDLE_MOUSE_CAPTURE; |
265 quirks_ |= PLUGIN_QUIRK_EMULATE_IME; | 265 quirks_ |= PLUGIN_QUIRK_EMULATE_IME; |
266 quirks_ |= PLUGIN_QUIRK_FAKE_WINDOW_FROM_POINT; | 266 quirks_ |= PLUGIN_QUIRK_FAKE_WINDOW_FROM_POINT; |
267 } else if (filename == kAcrobatReaderPlugin) { | 267 } else if (filename == kAcrobatReaderPlugin) { |
268 // Check for the version number above or equal 9. | 268 // Check for the version number above or equal 9. |
269 int major_version = GetPluginMajorVersion(plugin_info); | 269 unsigned int major_version = GetPluginMajorVersion(plugin_info); |
270 if (major_version >= 9) { | 270 if (major_version >= 9) { |
271 quirks_ |= PLUGIN_QUIRK_DIE_AFTER_UNLOAD; | 271 quirks_ |= PLUGIN_QUIRK_DIE_AFTER_UNLOAD; |
272 // 9.2 needs this. | 272 // 9.2 needs this. |
273 quirks_ |= PLUGIN_QUIRK_SETWINDOW_TWICE; | 273 quirks_ |= PLUGIN_QUIRK_SETWINDOW_TWICE; |
274 } | 274 } |
275 quirks_ |= PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS; | 275 quirks_ |= PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS; |
276 } else if (plugin_info.name.find(L"Windows Media Player") != | 276 } else if (plugin_info.name.find(L"Windows Media Player") != |
277 std::wstring::npos) { | 277 std::wstring::npos) { |
278 // Windows Media Player needs two NPP_SetWindow calls. | 278 // Windows Media Player needs two NPP_SetWindow calls. |
279 quirks_ |= PLUGIN_QUIRK_SETWINDOW_TWICE; | 279 quirks_ |= PLUGIN_QUIRK_SETWINDOW_TWICE; |
(...skipping 13 matching lines...) Expand all Loading... | |
293 } else if (instance_->mime_type() == "audio/x-pn-realaudio-plugin" || | 293 } else if (instance_->mime_type() == "audio/x-pn-realaudio-plugin" || |
294 filename == kRealPlayerPlugin) { | 294 filename == kRealPlayerPlugin) { |
295 quirks_ |= PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY; | 295 quirks_ |= PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY; |
296 } else if (plugin_info.name.find(L"VLC Multimedia Plugin") != | 296 } else if (plugin_info.name.find(L"VLC Multimedia Plugin") != |
297 std::wstring::npos || | 297 std::wstring::npos || |
298 plugin_info.name.find(L"VLC Multimedia Plug-in") != | 298 plugin_info.name.find(L"VLC Multimedia Plug-in") != |
299 std::wstring::npos) { | 299 std::wstring::npos) { |
300 // VLC hangs on NPP_Destroy if we call NPP_SetWindow with a null window | 300 // VLC hangs on NPP_Destroy if we call NPP_SetWindow with a null window |
301 // handle | 301 // handle |
302 quirks_ |= PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY; | 302 quirks_ |= PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY; |
303 int major_version = GetPluginMajorVersion(plugin_info); | 303 unsigned int major_version = GetPluginMajorVersion(plugin_info); |
304 if (major_version == 0) { | 304 if (major_version == 0) { |
305 // VLC 0.8.6d and 0.8.6e crash if multiple instances are created. | 305 // VLC 0.8.6d and 0.8.6e crash if multiple instances are created. |
306 quirks_ |= PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES; | 306 quirks_ |= PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES; |
307 } | 307 } |
308 } else if (filename == kSilverlightPlugin) { | 308 } else if (filename == kSilverlightPlugin) { |
309 // Explanation for this quirk can be found in | 309 // Explanation for this quirk can be found in |
310 // WebPluginDelegateImpl::Initialize. | 310 // WebPluginDelegateImpl::Initialize. |
311 quirks_ |= PLUGIN_QUIRK_PATCH_SETCURSOR; | 311 quirks_ |= PLUGIN_QUIRK_PATCH_SETCURSOR; |
312 } else if (plugin_info.name.find(L"DivX Web Player") != | 312 } else if (plugin_info.name.find(L"DivX Web Player") != |
313 std::wstring::npos) { | 313 std::wstring::npos) { |
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1481 case WM_RBUTTONUP: | 1481 case WM_RBUTTONUP: |
1482 ::ReleaseCapture(); | 1482 ::ReleaseCapture(); |
1483 break; | 1483 break; |
1484 | 1484 |
1485 default: | 1485 default: |
1486 break; | 1486 break; |
1487 } | 1487 } |
1488 } | 1488 } |
1489 | 1489 |
1490 } // namespace content | 1490 } // namespace content |
OLD | NEW |