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 "chrome/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 |
11 #include <algorithm> | 11 #include <algorithm> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/ref_counted.h" | 17 #include "base/ref_counted.h" |
18 #include "base/scoped_ptr.h" | 18 #include "base/scoped_ptr.h" |
19 #include "base/string_split.h" | 19 #include "base/string_split.h" |
20 #include "base/string_util.h" | 20 #include "base/string_util.h" |
21 #include "base/sys_info.h" | 21 #include "base/sys_info.h" |
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/command_buffer_proxy.h" | |
26 #include "chrome/renderer/plugin_channel_host.h" | |
27 #include "chrome/renderer/render_thread.h" | 25 #include "chrome/renderer/render_thread.h" |
28 #include "chrome/renderer/render_view.h" | 26 #include "chrome/renderer/render_view.h" |
29 #include "content/common/plugin_messages.h" | 27 #include "content/common/plugin_messages.h" |
30 #include "content/plugin/npobject_proxy.h" | 28 #include "content/plugin/npobject_proxy.h" |
31 #include "content/plugin/npobject_stub.h" | 29 #include "content/plugin/npobject_stub.h" |
32 #include "content/plugin/npobject_util.h" | 30 #include "content/plugin/npobject_util.h" |
33 #include "grit/generated_resources.h" | 31 #include "content/renderer/command_buffer_proxy.h" |
34 #include "grit/renderer_resources.h" | 32 #include "content/renderer/plugin_channel_host.h" |
| 33 //#include "grit/renderer_resources.h" |
35 #include "ipc/ipc_channel_handle.h" | 34 #include "ipc/ipc_channel_handle.h" |
36 #include "net/base/mime_util.h" | 35 #include "net/base/mime_util.h" |
37 #include "skia/ext/platform_canvas.h" | 36 #include "skia/ext/platform_canvas.h" |
38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" |
39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragData.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragData.h" |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
44 #include "ui/base/resource/resource_bundle.h" | 43 #include "ui/base/resource/resource_bundle.h" |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 } | 1144 } |
1146 | 1145 |
1147 void WebPluginDelegateProxy::OnMissingPluginStatus(int status) { | 1146 void WebPluginDelegateProxy::OnMissingPluginStatus(int status) { |
1148 if (render_view_) | 1147 if (render_view_) |
1149 render_view_->OnMissingPluginStatus(this, status); | 1148 render_view_->OnMissingPluginStatus(this, status); |
1150 } | 1149 } |
1151 | 1150 |
1152 void WebPluginDelegateProxy::PaintSadPlugin(WebKit::WebCanvas* native_context, | 1151 void WebPluginDelegateProxy::PaintSadPlugin(WebKit::WebCanvas* native_context, |
1153 const gfx::Rect& rect) { | 1152 const gfx::Rect& rect) { |
1154 // Lazily load the sad plugin image. | 1153 // Lazily load the sad plugin image. |
| 1154 /* temporarily disabled by jam |
1155 if (!sad_plugin_) { | 1155 if (!sad_plugin_) { |
1156 sad_plugin_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( | 1156 sad_plugin_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( |
1157 IDR_SAD_PLUGIN); | 1157 IDR_SAD_PLUGIN); |
1158 } | 1158 } |
| 1159 */ |
1159 if (!sad_plugin_) | 1160 if (!sad_plugin_) |
1160 return; | 1161 return; |
1161 | 1162 |
1162 // Make a temporary canvas for the background image. | 1163 // Make a temporary canvas for the background image. |
1163 const int width = plugin_rect_.width(); | 1164 const int width = plugin_rect_.width(); |
1164 const int height = plugin_rect_.height(); | 1165 const int height = plugin_rect_.height(); |
1165 gfx::CanvasSkia canvas(width, height, false); | 1166 gfx::CanvasSkia canvas(width, height, false); |
1166 #if defined(OS_MACOSX) | 1167 #if defined(OS_MACOSX) |
1167 // Flip the canvas, since the context expects flipped data. | 1168 // Flip the canvas, since the context expects flipped data. |
1168 canvas.translate(0, height); | 1169 canvas.translate(0, height); |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 } | 1421 } |
1421 #endif | 1422 #endif |
1422 | 1423 |
1423 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1424 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
1424 int resource_id) { | 1425 int resource_id) { |
1425 if (!plugin_) | 1426 if (!plugin_) |
1426 return; | 1427 return; |
1427 | 1428 |
1428 plugin_->URLRedirectResponse(allow, resource_id); | 1429 plugin_->URLRedirectResponse(allow, resource_id); |
1429 } | 1430 } |
OLD | NEW |