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

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

Issue 2752009: Fix media player painting bug. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 months 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/glue/plugins/webplugin_delegate_impl.h" 5 #include "webkit/glue/plugins/webplugin_delegate_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 is_calling_wndproc(false), 253 is_calling_wndproc(false),
254 keyboard_layout_(NULL), 254 keyboard_layout_(NULL),
255 parent_thread_id_(0), 255 parent_thread_id_(0),
256 dummy_window_for_activation_(NULL), 256 dummy_window_for_activation_(NULL),
257 handle_event_message_filter_hook_(NULL), 257 handle_event_message_filter_hook_(NULL),
258 handle_event_pump_messages_event_(NULL), 258 handle_event_pump_messages_event_(NULL),
259 user_gesture_message_posted_(false), 259 user_gesture_message_posted_(false),
260 #pragma warning(suppress: 4355) // can use this 260 #pragma warning(suppress: 4355) // can use this
261 user_gesture_msg_factory_(this), 261 user_gesture_msg_factory_(this),
262 handle_event_depth_(0), 262 handle_event_depth_(0),
263 mouse_hook_(NULL) { 263 mouse_hook_(NULL),
264 first_set_window_call_(true) {
264 memset(&window_, 0, sizeof(window_)); 265 memset(&window_, 0, sizeof(window_));
265 266
266 const WebPluginInfo& plugin_info = instance_->plugin_lib()->plugin_info(); 267 const WebPluginInfo& plugin_info = instance_->plugin_lib()->plugin_info();
267 std::wstring filename = 268 std::wstring filename =
268 StringToLowerASCII(plugin_info.path.BaseName().value()); 269 StringToLowerASCII(plugin_info.path.BaseName().value());
269 270
270 if (instance_->mime_type() == "application/x-shockwave-flash" || 271 if (instance_->mime_type() == "application/x-shockwave-flash" ||
271 filename == kFlashPlugin) { 272 filename == kFlashPlugin) {
272 // Flash only requests windowless plugins if we return a Mozilla user 273 // Flash only requests windowless plugins if we return a Mozilla user
273 // agent. 274 // agent.
(...skipping 17 matching lines...) Expand all
291 } 292 }
292 quirks_ |= PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS; 293 quirks_ |= PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS;
293 } else if (plugin_info.name.find(L"Windows Media Player") != 294 } else if (plugin_info.name.find(L"Windows Media Player") !=
294 std::wstring::npos) { 295 std::wstring::npos) {
295 // Windows Media Player needs two NPP_SetWindow calls. 296 // Windows Media Player needs two NPP_SetWindow calls.
296 quirks_ |= PLUGIN_QUIRK_SETWINDOW_TWICE; 297 quirks_ |= PLUGIN_QUIRK_SETWINDOW_TWICE;
297 298
298 // Windowless mode doesn't work in the WMP NPAPI plugin. 299 // Windowless mode doesn't work in the WMP NPAPI plugin.
299 quirks_ |= PLUGIN_QUIRK_NO_WINDOWLESS; 300 quirks_ |= PLUGIN_QUIRK_NO_WINDOWLESS;
300 301
302 // The media player plugin sets its size on the first NPP_SetWindow call
303 // and never updates its size. We should call the underlying NPP_SetWindow
304 // only when we have the correct size.
305 quirks_ |= PLUGIN_QUIRK_IGNORE_FIRST_SETWINDOW_CALL;
306
301 if (filename == kOldWMPPlugin) { 307 if (filename == kOldWMPPlugin) {
302 // Non-admin users on XP couldn't modify the key to force the new UI. 308 // Non-admin users on XP couldn't modify the key to force the new UI.
303 quirks_ |= PLUGIN_QUIRK_PATCH_REGENUMKEYEXW; 309 quirks_ |= PLUGIN_QUIRK_PATCH_REGENUMKEYEXW;
304 } 310 }
305 } else if (instance_->mime_type() == "audio/x-pn-realaudio-plugin" || 311 } else if (instance_->mime_type() == "audio/x-pn-realaudio-plugin" ||
306 filename == kRealPlayerPlugin) { 312 filename == kRealPlayerPlugin) {
307 quirks_ |= PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY; 313 quirks_ |= PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY;
308 } else if (plugin_info.name.find(L"VLC Multimedia Plugin") != 314 } else if (plugin_info.name.find(L"VLC Multimedia Plugin") !=
309 std::wstring::npos || 315 std::wstring::npos ||
310 plugin_info.name.find(L"VLC Multimedia Plug-in") != 316 plugin_info.name.find(L"VLC Multimedia Plug-in") !=
311 std::wstring::npos) { 317 std::wstring::npos) {
312 // VLC hangs on NPP_Destroy if we call NPP_SetWindow with a null window 318 // VLC hangs on NPP_Destroy if we call NPP_SetWindow with a null window
313 // handle 319 // handle
314 quirks_ |= PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY; 320 quirks_ |= PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY;
315 // VLC 0.8.6d and 0.8.6e crash if multiple instances are created. 321 // VLC 0.8.6d and 0.8.6e crash if multiple instances are created.
316 quirks_ |= PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES; 322 quirks_ |= PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES;
317 } else if (filename == kSilverlightPlugin) { 323 } else if (filename == kSilverlightPlugin) {
318 // Explanation for this quirk can be found in 324 // Explanation for this quirk can be found in
319 // WebPluginDelegateImpl::Initialize. 325 // WebPluginDelegateImpl::Initialize.
320 quirks_ |= PLUGIN_QUIRK_PATCH_SETCURSOR; 326 quirks_ |= PLUGIN_QUIRK_PATCH_SETCURSOR;
327 } else if (plugin_info.name.find(L"DivX Web Player") !=
328 std::wstring::npos) {
329 // The divx plugin sets its size on the first NPP_SetWindow call and never
330 // updates its size. We should call the underlying NPP_SetWindow only when
331 // we have the correct size.
332 quirks_ |= PLUGIN_QUIRK_IGNORE_FIRST_SETWINDOW_CALL;
321 } 333 }
322 } 334 }
323 335
324 WebPluginDelegateImpl::~WebPluginDelegateImpl() { 336 WebPluginDelegateImpl::~WebPluginDelegateImpl() {
325 if (::IsWindow(dummy_window_for_activation_)) { 337 if (::IsWindow(dummy_window_for_activation_)) {
326 ::DestroyWindow(dummy_window_for_activation_); 338 ::DestroyWindow(dummy_window_for_activation_);
327 } 339 }
328 340
329 DestroyInstance(); 341 DestroyInstance();
330 342
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 case WM_LBUTTONUP: 1387 case WM_LBUTTONUP:
1376 case WM_MBUTTONUP: 1388 case WM_MBUTTONUP:
1377 case WM_RBUTTONUP: 1389 case WM_RBUTTONUP:
1378 ::ReleaseCapture(); 1390 ::ReleaseCapture();
1379 break; 1391 break;
1380 1392
1381 default: 1393 default:
1382 break; 1394 break;
1383 } 1395 }
1384 } 1396 }
OLDNEW
« no previous file with comments | « webkit/glue/plugins/webplugin_delegate_impl_mac.mm ('k') | webkit/glue/plugins/webplugin_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698