| 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/npapi/webplugin_delegate_proxy.h" | 5 #include "content/renderer/npapi/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 11 matching lines...) Expand all Loading... |
| 22 #include "base/process/process.h" | 22 #include "base/process/process.h" |
| 23 #include "base/strings/string_split.h" | 23 #include "base/strings/string_split.h" |
| 24 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
| 25 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
| 26 #include "base/version.h" | 26 #include "base/version.h" |
| 27 #include "content/child/child_process.h" | 27 #include "content/child/child_process.h" |
| 28 #include "content/child/npapi/npobject_proxy.h" | 28 #include "content/child/npapi/npobject_proxy.h" |
| 29 #include "content/child/npapi/npobject_stub.h" | 29 #include "content/child/npapi/npobject_stub.h" |
| 30 #include "content/child/npapi/npobject_util.h" | 30 #include "content/child/npapi/npobject_util.h" |
| 31 #include "content/child/npapi/webplugin.h" | 31 #include "content/child/npapi/webplugin.h" |
| 32 #include "content/child/npapi/webplugin_resource_client.h" |
| 32 #include "content/child/plugin_messages.h" | 33 #include "content/child/plugin_messages.h" |
| 33 #include "content/common/content_constants_internal.h" | 34 #include "content/common/content_constants_internal.h" |
| 34 #include "content/common/view_messages.h" | 35 #include "content/common/view_messages.h" |
| 35 #include "content/public/renderer/content_renderer_client.h" | 36 #include "content/public/renderer/content_renderer_client.h" |
| 36 #include "content/renderer/npapi/plugin_channel_host.h" | 37 #include "content/renderer/npapi/plugin_channel_host.h" |
| 37 #include "content/renderer/render_thread_impl.h" | 38 #include "content/renderer/render_thread_impl.h" |
| 38 #include "content/renderer/render_view_impl.h" | 39 #include "content/renderer/render_view_impl.h" |
| 39 #include "content/renderer/sad_plugin.h" | 40 #include "content/renderer/sad_plugin.h" |
| 40 #include "ipc/ipc_channel_handle.h" | 41 #include "ipc/ipc_channel_handle.h" |
| 41 #include "net/base/mime_util.h" | 42 #include "net/base/mime_util.h" |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 } | 666 } |
| 666 | 667 |
| 667 #if defined(OS_MACOSX) | 668 #if defined(OS_MACOSX) |
| 668 // Flips |rect| vertically within an enclosing rect with height |height|. | 669 // Flips |rect| vertically within an enclosing rect with height |height|. |
| 669 // Intended for converting rects between flipped and non-flipped contexts. | 670 // Intended for converting rects between flipped and non-flipped contexts. |
| 670 static void FlipRectVerticallyWithHeight(gfx::Rect* rect, int height) { | 671 static void FlipRectVerticallyWithHeight(gfx::Rect* rect, int height) { |
| 671 rect->set_y(height - rect->bottom()); | 672 rect->set_y(height - rect->bottom()); |
| 672 } | 673 } |
| 673 #endif | 674 #endif |
| 674 | 675 |
| 675 void WebPluginDelegateProxy::Paint(WebKit::WebCanvas* canvas, | 676 void WebPluginDelegateProxy::Paint(SkCanvas* canvas, |
| 676 const gfx::Rect& damaged_rect) { | 677 const gfx::Rect& damaged_rect) { |
| 677 // Limit the damaged rectangle to whatever is contained inside the plugin | 678 // Limit the damaged rectangle to whatever is contained inside the plugin |
| 678 // rectangle, as that's the rectangle that we'll actually draw. | 679 // rectangle, as that's the rectangle that we'll actually draw. |
| 679 gfx::Rect rect = gfx::IntersectRects(damaged_rect, plugin_rect_); | 680 gfx::Rect rect = gfx::IntersectRects(damaged_rect, plugin_rect_); |
| 680 | 681 |
| 681 // If the plugin is no longer connected (channel crashed) draw a crashed | 682 // If the plugin is no longer connected (channel crashed) draw a crashed |
| 682 // plugin bitmap | 683 // plugin bitmap |
| 683 if (!channel_host_.get() || !channel_host_->channel_valid()) { | 684 if (!channel_host_.get() || !channel_host_->channel_valid()) { |
| 684 // Lazily load the sad plugin image. | 685 // Lazily load the sad plugin image. |
| 685 if (!sad_plugin_) | 686 if (!sad_plugin_) |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 | 1198 |
| 1198 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1199 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
| 1199 int resource_id) { | 1200 int resource_id) { |
| 1200 if (!plugin_) | 1201 if (!plugin_) |
| 1201 return; | 1202 return; |
| 1202 | 1203 |
| 1203 plugin_->URLRedirectResponse(allow, resource_id); | 1204 plugin_->URLRedirectResponse(allow, resource_id); |
| 1204 } | 1205 } |
| 1205 | 1206 |
| 1206 } // namespace content | 1207 } // namespace content |
| OLD | NEW |