| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/pepper_plugin_instance.h" | 5 #include "webkit/glue/plugins/pepper_plugin_instance.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "gfx/rect.h" | 9 #include "gfx/rect.h" |
| 10 #include "third_party/ppapi/c/pp_instance.h" | 10 #include "third_party/ppapi/c/pp_instance.h" |
| 11 #include "third_party/ppapi/c/pp_event.h" | 11 #include "third_party/ppapi/c/pp_event.h" |
| 12 #include "third_party/ppapi/c/pp_rect.h" | 12 #include "third_party/ppapi/c/pp_rect.h" |
| 13 #include "third_party/ppapi/c/pp_resource.h" | 13 #include "third_party/ppapi/c/pp_resource.h" |
| 14 #include "third_party/ppapi/c/pp_var.h" | 14 #include "third_party/ppapi/c/pp_var.h" |
| 15 #include "third_party/ppapi/c/ppb_instance.h" | 15 #include "third_party/ppapi/c/ppb_instance.h" |
| 16 #include "third_party/ppapi/c/ppp_instance.h" | 16 #include "third_party/ppapi/c/ppp_instance.h" |
| 17 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" | 17 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" |
| 18 #include "third_party/WebKit/WebKit/chromium/public/WebElement.h" | 18 #include "third_party/WebKit/WebKit/chromium/public/WebElement.h" |
| 19 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 19 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
| 20 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" | 20 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" |
| 21 #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h" | 21 #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h" |
| 22 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" | 22 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" |
| 23 #include "webkit/glue/plugins/pepper_device_context_2d.h" | 23 #include "webkit/glue/plugins/pepper_device_context_2d.h" |
| 24 #include "webkit/glue/plugins/pepper_plugin_delegate.h" |
| 24 #include "webkit/glue/plugins/pepper_plugin_module.h" | 25 #include "webkit/glue/plugins/pepper_plugin_module.h" |
| 25 #include "webkit/glue/plugins/pepper_resource_tracker.h" | 26 #include "webkit/glue/plugins/pepper_resource_tracker.h" |
| 26 #include "webkit/glue/plugins/pepper_var.h" | 27 #include "webkit/glue/plugins/pepper_var.h" |
| 27 | 28 |
| 28 using WebKit::WebFrame; | 29 using WebKit::WebFrame; |
| 29 using WebKit::WebInputEvent; | 30 using WebKit::WebInputEvent; |
| 30 using WebKit::WebPluginContainer; | 31 using WebKit::WebPluginContainer; |
| 31 | 32 |
| 32 namespace pepper { | 33 namespace pepper { |
| 33 | 34 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 140 |
| 140 PluginInstance::PluginInstance(PluginDelegate* delegate, | 141 PluginInstance::PluginInstance(PluginDelegate* delegate, |
| 141 PluginModule* module, | 142 PluginModule* module, |
| 142 const PPP_Instance* instance_interface) | 143 const PPP_Instance* instance_interface) |
| 143 : delegate_(delegate), | 144 : delegate_(delegate), |
| 144 module_(module), | 145 module_(module), |
| 145 instance_interface_(instance_interface), | 146 instance_interface_(instance_interface), |
| 146 container_(NULL) { | 147 container_(NULL) { |
| 147 DCHECK(delegate); | 148 DCHECK(delegate); |
| 148 module_->InstanceCreated(this); | 149 module_->InstanceCreated(this); |
| 150 delegate_->InstanceCreated(this); |
| 149 } | 151 } |
| 150 | 152 |
| 151 PluginInstance::~PluginInstance() { | 153 PluginInstance::~PluginInstance() { |
| 154 delegate_->InstanceDeleted(this); |
| 152 module_->InstanceDeleted(this); | 155 module_->InstanceDeleted(this); |
| 153 } | 156 } |
| 154 | 157 |
| 155 // static | 158 // static |
| 156 const PPB_Instance* PluginInstance::GetInterface() { | 159 const PPB_Instance* PluginInstance::GetInterface() { |
| 157 return &ppb_instance; | 160 return &ppb_instance; |
| 158 } | 161 } |
| 159 | 162 |
| 160 // static | 163 // static |
| 161 PluginInstance* PluginInstance::FromPPInstance(PP_Instance instance) { | 164 PluginInstance* PluginInstance::FromPPInstance(PP_Instance instance) { |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 if (device_context_2d_) | 316 if (device_context_2d_) |
| 314 device_context_2d_->ViewInitiatedPaint(); | 317 device_context_2d_->ViewInitiatedPaint(); |
| 315 } | 318 } |
| 316 | 319 |
| 317 void PluginInstance::ViewFlushedPaint() { | 320 void PluginInstance::ViewFlushedPaint() { |
| 318 if (device_context_2d_) | 321 if (device_context_2d_) |
| 319 device_context_2d_->ViewFlushedPaint(); | 322 device_context_2d_->ViewFlushedPaint(); |
| 320 } | 323 } |
| 321 | 324 |
| 322 } // namespace pepper | 325 } // namespace pepper |
| OLD | NEW |