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 #include "content/renderer/webplugin_delegate_proxy.h" | 5 #include "content/renderer/webplugin_delegate_proxy.h" |
6 | 6 |
7 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "base/utf_string_conversions.h" | 22 #include "base/utf_string_conversions.h" |
23 #include "chrome/common/child_process_logging.h" | 23 #include "chrome/common/child_process_logging.h" |
24 #include "chrome/common/render_messages.h" | 24 #include "chrome/common/render_messages.h" |
25 #include "chrome/renderer/render_thread.h" | 25 #include "chrome/renderer/render_thread.h" |
26 #include "chrome/renderer/render_view.h" | 26 #include "chrome/renderer/render_view.h" |
27 #include "content/common/plugin_messages.h" | 27 #include "content/common/plugin_messages.h" |
28 #include "content/plugin/npobject_proxy.h" | 28 #include "content/plugin/npobject_proxy.h" |
29 #include "content/plugin/npobject_stub.h" | 29 #include "content/plugin/npobject_stub.h" |
30 #include "content/plugin/npobject_util.h" | 30 #include "content/plugin/npobject_util.h" |
31 #include "content/renderer/command_buffer_proxy.h" | 31 #include "content/renderer/command_buffer_proxy.h" |
| 32 #include "content/renderer/content_renderer_client.h" |
32 #include "content/renderer/plugin_channel_host.h" | 33 #include "content/renderer/plugin_channel_host.h" |
33 //#include "grit/renderer_resources.h" | |
34 #include "ipc/ipc_channel_handle.h" | 34 #include "ipc/ipc_channel_handle.h" |
35 #include "net/base/mime_util.h" | 35 #include "net/base/mime_util.h" |
36 #include "skia/ext/platform_canvas.h" | 36 #include "skia/ext/platform_canvas.h" |
37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" |
38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragData.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragData.h" |
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
43 #include "ui/base/resource/resource_bundle.h" | |
44 #include "ui/gfx/blit.h" | 43 #include "ui/gfx/blit.h" |
45 #include "ui/gfx/canvas_skia.h" | 44 #include "ui/gfx/canvas_skia.h" |
46 #include "ui/gfx/native_widget_types.h" | 45 #include "ui/gfx/native_widget_types.h" |
47 #include "ui/gfx/size.h" | 46 #include "ui/gfx/size.h" |
48 #include "webkit/plugins/npapi/webplugin.h" | 47 #include "webkit/plugins/npapi/webplugin.h" |
49 #include "webkit/glue/webkit_glue.h" | 48 #include "webkit/glue/webkit_glue.h" |
50 | 49 |
51 #if defined(OS_POSIX) | 50 #if defined(OS_POSIX) |
52 #include "ipc/ipc_channel_posix.h" | 51 #include "ipc/ipc_channel_posix.h" |
53 #endif | 52 #endif |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1144 } | 1143 } |
1145 | 1144 |
1146 void WebPluginDelegateProxy::OnMissingPluginStatus(int status) { | 1145 void WebPluginDelegateProxy::OnMissingPluginStatus(int status) { |
1147 if (render_view_) | 1146 if (render_view_) |
1148 render_view_->OnMissingPluginStatus(this, status); | 1147 render_view_->OnMissingPluginStatus(this, status); |
1149 } | 1148 } |
1150 | 1149 |
1151 void WebPluginDelegateProxy::PaintSadPlugin(WebKit::WebCanvas* native_context, | 1150 void WebPluginDelegateProxy::PaintSadPlugin(WebKit::WebCanvas* native_context, |
1152 const gfx::Rect& rect) { | 1151 const gfx::Rect& rect) { |
1153 // Lazily load the sad plugin image. | 1152 // Lazily load the sad plugin image. |
1154 /* temporarily disabled by jam | 1153 if (!sad_plugin_) |
1155 if (!sad_plugin_) { | 1154 sad_plugin_ = content::GetContentClient()->renderer()->GetSadPluginBitmap(); |
1156 sad_plugin_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( | 1155 |
1157 IDR_SAD_PLUGIN); | |
1158 } | |
1159 */ | |
1160 if (!sad_plugin_) | 1156 if (!sad_plugin_) |
1161 return; | 1157 return; |
1162 | 1158 |
1163 // Make a temporary canvas for the background image. | 1159 // Make a temporary canvas for the background image. |
1164 const int width = plugin_rect_.width(); | 1160 const int width = plugin_rect_.width(); |
1165 const int height = plugin_rect_.height(); | 1161 const int height = plugin_rect_.height(); |
1166 gfx::CanvasSkia canvas(width, height, false); | 1162 gfx::CanvasSkia canvas(width, height, false); |
1167 #if defined(OS_MACOSX) | 1163 #if defined(OS_MACOSX) |
1168 // Flip the canvas, since the context expects flipped data. | 1164 // Flip the canvas, since the context expects flipped data. |
1169 canvas.translate(0, height); | 1165 canvas.translate(0, height); |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 } | 1417 } |
1422 #endif | 1418 #endif |
1423 | 1419 |
1424 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1420 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
1425 int resource_id) { | 1421 int resource_id) { |
1426 if (!plugin_) | 1422 if (!plugin_) |
1427 return; | 1423 return; |
1428 | 1424 |
1429 plugin_->URLRedirectResponse(allow, resource_id); | 1425 plugin_->URLRedirectResponse(allow, resource_id); |
1430 } | 1426 } |
OLD | NEW |