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

Side by Side Diff: webkit/plugins/ppapi/ppapi_webplugin_impl.cc

Issue 6538028: A proposal for an initial postMessage interface. This will allow JavaScript ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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) 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
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 (object) {
94 return object->np_object(); 95 instance_->
brettw 2011/03/16 21:34:11 I'd probably have wrapped this like: instance_->me
96 message_channel().set_passthrough_object(object->np_object());
97 }
98 return instance_->message_channel().np_object();
95 return NULL; 99 return NULL;
96 } 100 }
97 101
98 void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& rect) { 102 void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& rect) {
99 if (!instance_->IsFullscreenOrPending()) 103 if (!instance_->IsFullscreenOrPending())
100 instance_->Paint(canvas, plugin_rect_, rect); 104 instance_->Paint(canvas, plugin_rect_, rect);
101 } 105 }
102 106
103 void WebPluginImpl::updateGeometry( 107 void WebPluginImpl::updateGeometry(
104 const WebRect& window_rect, 108 const WebRect& window_rect,
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 return instance_->PrintPage(page_number, canvas); 224 return instance_->PrintPage(page_number, canvas);
221 } 225 }
222 226
223 void WebPluginImpl::printEnd() { 227 void WebPluginImpl::printEnd() {
224 return instance_->PrintEnd(); 228 return instance_->PrintEnd();
225 } 229 }
226 230
227 } // namespace ppapi 231 } // namespace ppapi
228 } // namespace webkit 232 } // namespace webkit
229 233
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698