| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/plugins/npapi/webplugin_delegate_impl.h" | 8 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 WebInputEvent::RightButtonDown | | 249 WebInputEvent::RightButtonDown | |
| 250 WebInputEvent::MiddleButtonDown; | 250 WebInputEvent::MiddleButtonDown; |
| 251 } | 251 } |
| 252 | 252 |
| 253 #pragma mark - | 253 #pragma mark - |
| 254 #pragma mark Core WebPluginDelegate implementation | 254 #pragma mark Core WebPluginDelegate implementation |
| 255 | 255 |
| 256 WebPluginDelegateImpl::WebPluginDelegateImpl( | 256 WebPluginDelegateImpl::WebPluginDelegateImpl( |
| 257 gfx::PluginWindowHandle containing_view, | 257 gfx::PluginWindowHandle containing_view, |
| 258 PluginInstance *instance) | 258 PluginInstance *instance) |
| 259 : windowed_handle_(NULL), | 259 : windowed_handle_(0), |
| 260 // all Mac plugins are "windowless" in the Windows/X11 sense | 260 // all Mac plugins are "windowless" in the Windows/X11 sense |
| 261 windowless_(true), | 261 windowless_(true), |
| 262 plugin_(NULL), | 262 plugin_(NULL), |
| 263 instance_(instance), | 263 instance_(instance), |
| 264 parent_(containing_view), | 264 parent_(containing_view), |
| 265 quirks_(0), | 265 quirks_(0), |
| 266 use_buffer_context_(true), | 266 use_buffer_context_(true), |
| 267 buffer_context_(NULL), | 267 buffer_context_(NULL), |
| 268 layer_(nil), | 268 layer_(nil), |
| 269 surface_(NULL), | 269 surface_(NULL), |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 default: | 419 default: |
| 420 NOTREACHED(); | 420 NOTREACHED(); |
| 421 break; | 421 break; |
| 422 } | 422 } |
| 423 | 423 |
| 424 // Let the WebPlugin know that we are windowless, unless this is a Core | 424 // Let the WebPlugin know that we are windowless, unless this is a Core |
| 425 // Animation plugin, in which case AcceleratedPluginEnabledRendering | 425 // Animation plugin, in which case AcceleratedPluginEnabledRendering |
| 426 // calls SetWindow. Rendering breaks if SetWindow is called before | 426 // calls SetWindow. Rendering breaks if SetWindow is called before |
| 427 // accelerated rendering is enabled. | 427 // accelerated rendering is enabled. |
| 428 if (!layer_) | 428 if (!layer_) |
| 429 plugin_->SetWindow(NULL); | 429 plugin_->SetWindow(0); |
| 430 | 430 |
| 431 #ifndef NP_NO_CARBON | 431 #ifndef NP_NO_CARBON |
| 432 // If the plugin wants Carbon events, hook up to the source of idle events. | 432 // If the plugin wants Carbon events, hook up to the source of idle events. |
| 433 if (instance()->event_model() == NPEventModelCarbon) | 433 if (instance()->event_model() == NPEventModelCarbon) |
| 434 UpdateIdleEventRate(); | 434 UpdateIdleEventRate(); |
| 435 #endif | 435 #endif |
| 436 | 436 |
| 437 // QuickTime (in QD mode only) can crash if it gets other calls (e.g., | 437 // QuickTime (in QD mode only) can crash if it gets other calls (e.g., |
| 438 // NPP_Write) before it gets a SetWindow call, so call SetWindow (with a 0x0 | 438 // NPP_Write) before it gets a SetWindow call, so call SetWindow (with a 0x0 |
| 439 // rect) immediately. | 439 // rect) immediately. |
| (...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 qd_manager_->SetFastPathEnabled(enabled); | 1239 qd_manager_->SetFastPathEnabled(enabled); |
| 1240 qd_port_.port = qd_manager_->port(); | 1240 qd_port_.port = qd_manager_->port(); |
| 1241 WindowlessSetWindow(); | 1241 WindowlessSetWindow(); |
| 1242 // Send a paint event so that the new buffer gets updated immediately. | 1242 // Send a paint event so that the new buffer gets updated immediately. |
| 1243 WindowlessPaint(buffer_context_, clip_rect_); | 1243 WindowlessPaint(buffer_context_, clip_rect_); |
| 1244 } | 1244 } |
| 1245 #endif // !NP_NO_QUICKDRAW | 1245 #endif // !NP_NO_QUICKDRAW |
| 1246 | 1246 |
| 1247 } // namespace npapi | 1247 } // namespace npapi |
| 1248 } // namespace webkit | 1248 } // namespace webkit |
| OLD | NEW |