Chromium Code Reviews| 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/plugins/ppapi/ppapi_webplugin_impl.h" | 5 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" |
| 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h" |
| 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 15 #include "webkit/plugins/ppapi/message_channel.h" | |
| 15 #include "webkit/plugins/ppapi/plugin_module.h" | 16 #include "webkit/plugins/ppapi/plugin_module.h" |
| 16 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 17 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 17 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" | 18 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" |
| 18 #include "webkit/plugins/ppapi/var.h" | 19 #include "webkit/plugins/ppapi/var.h" |
| 19 | 20 |
| 20 using WebKit::WebCanvas; | 21 using WebKit::WebCanvas; |
| 21 using WebKit::WebPluginContainer; | 22 using WebKit::WebPluginContainer; |
| 22 using WebKit::WebPluginParams; | 23 using WebKit::WebPluginParams; |
| 23 using WebKit::WebPoint; | 24 using WebKit::WebPoint; |
| 24 using WebKit::WebRect; | 25 using WebKit::WebRect; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 instance_->Delete(); | 84 instance_->Delete(); |
| 84 instance_ = NULL; | 85 instance_ = NULL; |
| 85 } | 86 } |
| 86 | 87 |
| 87 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 88 MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 88 } | 89 } |
| 89 | 90 |
| 90 NPObject* WebPluginImpl::scriptableObject() { | 91 NPObject* WebPluginImpl::scriptableObject() { |
| 91 scoped_refptr<ObjectVar> object( | 92 scoped_refptr<ObjectVar> object( |
| 92 ObjectVar::FromPPVar(instance_->GetInstanceObject())); | 93 ObjectVar::FromPPVar(instance_->GetInstanceObject())); |
| 93 if (object) | 94 // If there's an InstanceObject, tell the Instance's MessageChannel to pass |
| 94 return object->np_object(); | 95 // any non-postMessage calls to it. |
| 95 return NULL; | 96 if (object) { |
| 97 instance_->message_channel().set_passthrough_object( | |
| 98 object->np_object()); | |
| 99 } | |
| 100 // And return the instance's MessageChannel. | |
| 101 return instance_->message_channel().np_object(); | |
|
piman
2011/03/29 04:40:22
Mmmh.... This CL is causing http://code.google.com
| |
| 96 } | 102 } |
| 97 | 103 |
| 98 void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& rect) { | 104 void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& rect) { |
| 99 if (!instance_->IsFullscreenOrPending()) | 105 if (!instance_->IsFullscreenOrPending()) |
| 100 instance_->Paint(canvas, plugin_rect_, rect); | 106 instance_->Paint(canvas, plugin_rect_, rect); |
| 101 } | 107 } |
| 102 | 108 |
| 103 void WebPluginImpl::updateGeometry( | 109 void WebPluginImpl::updateGeometry( |
| 104 const WebRect& window_rect, | 110 const WebRect& window_rect, |
| 105 const WebRect& clip_rect, | 111 const WebRect& clip_rect, |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 216 return instance_->PrintPage(page_number, canvas); | 222 return instance_->PrintPage(page_number, canvas); |
| 217 } | 223 } |
| 218 | 224 |
| 219 void WebPluginImpl::printEnd() { | 225 void WebPluginImpl::printEnd() { |
| 220 return instance_->PrintEnd(); | 226 return instance_->PrintEnd(); |
| 221 } | 227 } |
| 222 | 228 |
| 223 } // namespace ppapi | 229 } // namespace ppapi |
| 224 } // namespace webkit | 230 } // namespace webkit |
| 225 | 231 |
| OLD | NEW |