OLD | NEW |
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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 #import <QuartzCore/QuartzCore.h> | 6 #import <QuartzCore/QuartzCore.h> |
7 | 7 |
8 #include "webkit/glue/plugins/webplugin_delegate_impl.h" | 8 #include "webkit/glue/plugins/webplugin_delegate_impl.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 // care of setting up the appropriate window handle). | 334 // care of setting up the appropriate window handle). |
335 if (instance()->drawing_model() != NPDrawingModelCoreAnimation) | 335 if (instance()->drawing_model() != NPDrawingModelCoreAnimation) |
336 plugin_->SetWindow(NULL); | 336 plugin_->SetWindow(NULL); |
337 | 337 |
338 #ifndef NP_NO_CARBON | 338 #ifndef NP_NO_CARBON |
339 // If the plugin wants Carbon events, hook up to the source of idle events. | 339 // If the plugin wants Carbon events, hook up to the source of idle events. |
340 if (instance()->event_model() == NPEventModelCarbon) | 340 if (instance()->event_model() == NPEventModelCarbon) |
341 UpdateIdleEventRate(); | 341 UpdateIdleEventRate(); |
342 #endif | 342 #endif |
343 | 343 |
344 // QuickTime can crash if it gets other calls (e.g., NPP_Write) before it | 344 // QuickTime (in QD mode only) can crash if it gets other calls (e.g., |
345 // gets a SetWindow call, so call SetWindow (with a 0x0 rect) immediately. | 345 // NPP_Write) before it gets a SetWindow call, so call SetWindow (with a 0x0 |
346 const WebPluginInfo& plugin_info = instance_->plugin_lib()->plugin_info(); | 346 // rect) immediately. |
347 if (plugin_info.name.find(L"QuickTime") != std::wstring::npos) | 347 #ifndef NP_NO_QUICKDRAW |
348 WindowlessSetWindow(true); | 348 if (instance()->drawing_model() == NPDrawingModelQuickDraw) { |
| 349 const WebPluginInfo& plugin_info = instance_->plugin_lib()->plugin_info(); |
| 350 if (plugin_info.name.find(L"QuickTime") != std::wstring::npos) |
| 351 WindowlessSetWindow(true); |
| 352 } |
| 353 #endif |
349 } | 354 } |
350 | 355 |
351 void WebPluginDelegateImpl::PlatformDestroyInstance() { | 356 void WebPluginDelegateImpl::PlatformDestroyInstance() { |
352 #ifndef NP_NO_CARBON | 357 #ifndef NP_NO_CARBON |
353 if (instance()->event_model() == NPEventModelCarbon) | 358 if (instance()->event_model() == NPEventModelCarbon) |
354 CarbonIdleEventSource::SharedInstance()->UnregisterDelegate(this); | 359 CarbonIdleEventSource::SharedInstance()->UnregisterDelegate(this); |
355 #endif | 360 #endif |
356 if (redraw_timer_.get()) | 361 if (redraw_timer_.get()) |
357 redraw_timer_->Stop(); | 362 redraw_timer_->Stop(); |
358 [renderer_ release]; | 363 [renderer_ release]; |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 #ifndef NP_NO_QUICKDRAW | 1168 #ifndef NP_NO_QUICKDRAW |
1164 // Quickdraw-based plugins can draw at any time, so tell the renderer to | 1169 // Quickdraw-based plugins can draw at any time, so tell the renderer to |
1165 // repaint. | 1170 // repaint. |
1166 // TODO: only do this if the contents of the offscreen window/buffer have | 1171 // TODO: only do this if the contents of the offscreen window/buffer have |
1167 // changed, so as not to spam the renderer with an unchanging image. | 1172 // changed, so as not to spam the renderer with an unchanging image. |
1168 if (instance() && instance()->drawing_model() == NPDrawingModelQuickDraw) | 1173 if (instance() && instance()->drawing_model() == NPDrawingModelQuickDraw) |
1169 instance()->webplugin()->Invalidate(); | 1174 instance()->webplugin()->Invalidate(); |
1170 #endif | 1175 #endif |
1171 } | 1176 } |
1172 #endif // !NP_NO_CARBON | 1177 #endif // !NP_NO_CARBON |
OLD | NEW |