OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/webplugin_delegate_proxy.h" | 5 #include "content/renderer/webplugin_delegate_proxy.h" |
6 | 6 |
7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #elif defined(USE_X11) | 9 #elif defined(USE_X11) |
10 #include <cairo/cairo.h> | 10 #include <cairo/cairo.h> |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 uses_shared_bitmaps_(false), | 205 uses_shared_bitmaps_(false), |
206 #if defined(OS_MACOSX) | 206 #if defined(OS_MACOSX) |
207 uses_compositor_(false), | 207 uses_compositor_(false), |
208 #elif defined(OS_WIN) | 208 #elif defined(OS_WIN) |
209 dummy_activation_window_(NULL), | 209 dummy_activation_window_(NULL), |
210 #endif | 210 #endif |
211 window_(gfx::kNullPluginWindow), | 211 window_(gfx::kNullPluginWindow), |
212 mime_type_(mime_type), | 212 mime_type_(mime_type), |
213 instance_id_(MSG_ROUTING_NONE), | 213 instance_id_(MSG_ROUTING_NONE), |
214 npobject_(NULL), | 214 npobject_(NULL), |
| 215 npp_(new NPP_t), |
215 sad_plugin_(NULL), | 216 sad_plugin_(NULL), |
216 invalidate_pending_(false), | 217 invalidate_pending_(false), |
217 transparent_(false), | 218 transparent_(false), |
218 front_buffer_index_(0), | 219 front_buffer_index_(0), |
219 page_url_(render_view_->webview()->mainFrame()->document().url()) { | 220 page_url_(render_view_->webview()->mainFrame()->document().url()) { |
220 } | 221 } |
221 | 222 |
222 WebPluginDelegateProxy::~WebPluginDelegateProxy() { | 223 WebPluginDelegateProxy::~WebPluginDelegateProxy() { |
223 if (npobject_) | 224 if (npobject_) |
224 WebBindings::releaseObject(npobject_); | 225 WebBindings::releaseObject(npobject_); |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 Send(new PluginMsg_GetPluginScriptableObject(instance_id_, &route_id)); | 737 Send(new PluginMsg_GetPluginScriptableObject(instance_id_, &route_id)); |
737 if (route_id == MSG_ROUTING_NONE) | 738 if (route_id == MSG_ROUTING_NONE) |
738 return NULL; | 739 return NULL; |
739 | 740 |
740 npobject_ = NPObjectProxy::Create( | 741 npobject_ = NPObjectProxy::Create( |
741 channel_host_.get(), route_id, 0, page_url_); | 742 channel_host_.get(), route_id, 0, page_url_); |
742 | 743 |
743 return WebBindings::retainObject(npobject_); | 744 return WebBindings::retainObject(npobject_); |
744 } | 745 } |
745 | 746 |
| 747 NPP WebPluginDelegateProxy::GetPluginNPP() { |
| 748 // Return a dummy NPP for WebKit to use to identify this plugin. |
| 749 return npp_.get(); |
| 750 } |
| 751 |
746 bool WebPluginDelegateProxy::GetFormValue(string16* value) { | 752 bool WebPluginDelegateProxy::GetFormValue(string16* value) { |
747 bool success = false; | 753 bool success = false; |
748 Send(new PluginMsg_GetFormValue(instance_id_, value, &success)); | 754 Send(new PluginMsg_GetFormValue(instance_id_, value, &success)); |
749 return success; | 755 return success; |
750 } | 756 } |
751 | 757 |
752 void WebPluginDelegateProxy::DidFinishLoadWithReason( | 758 void WebPluginDelegateProxy::DidFinishLoadWithReason( |
753 const GURL& url, NPReason reason, int notify_id) { | 759 const GURL& url, NPReason reason, int notify_id) { |
754 Send(new PluginMsg_DidFinishLoadWithReason( | 760 Send(new PluginMsg_DidFinishLoadWithReason( |
755 instance_id_, url, reason, notify_id)); | 761 instance_id_, url, reason, notify_id)); |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 | 1206 |
1201 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1207 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
1202 int resource_id) { | 1208 int resource_id) { |
1203 if (!plugin_) | 1209 if (!plugin_) |
1204 return; | 1210 return; |
1205 | 1211 |
1206 plugin_->URLRedirectResponse(allow, resource_id); | 1212 plugin_->URLRedirectResponse(allow, resource_id); |
1207 } | 1213 } |
1208 | 1214 |
1209 } // namespace content | 1215 } // namespace content |
OLD | NEW |