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 #elif defined(USE_X11) | 9 #elif defined(USE_X11) |
10 #include <cairo/cairo.h> | 10 #include <cairo/cairo.h> |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 // invalidate from the plugin, since this message acts as an access token | 744 // invalidate from the plugin, since this message acts as an access token |
745 // to ensure only one process is using the transport dib at a time. | 745 // to ensure only one process is using the transport dib at a time. |
746 invalidate_pending_ = false; | 746 invalidate_pending_ = false; |
747 Send(new PluginMsg_DidPaint(instance_id_)); | 747 Send(new PluginMsg_DidPaint(instance_id_)); |
748 } | 748 } |
749 } | 749 } |
750 | 750 |
751 bool WebPluginDelegateProxy::BackgroundChanged( | 751 bool WebPluginDelegateProxy::BackgroundChanged( |
752 gfx::NativeDrawingContext context, | 752 gfx::NativeDrawingContext context, |
753 const gfx::Rect& rect) { | 753 const gfx::Rect& rect) { |
| 754 #if defined(OS_ANDROID) |
| 755 NOTIMPLEMENTED(); |
| 756 #else |
754 #if defined(OS_WIN) | 757 #if defined(OS_WIN) |
755 HBITMAP hbitmap = static_cast<HBITMAP>(GetCurrentObject(context, OBJ_BITMAP)); | 758 HBITMAP hbitmap = static_cast<HBITMAP>(GetCurrentObject(context, OBJ_BITMAP)); |
756 if (hbitmap == NULL) { | 759 if (hbitmap == NULL) { |
757 NOTREACHED(); | 760 NOTREACHED(); |
758 return true; | 761 return true; |
759 } | 762 } |
760 | 763 |
761 BITMAP bitmap = { 0 }; | 764 BITMAP bitmap = { 0 }; |
762 int result = GetObject(hbitmap, sizeof(bitmap), &bitmap); | 765 int result = GetObject(hbitmap, sizeof(bitmap), &bitmap); |
763 if (!result) { | 766 if (!result) { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 // The background buffer is upside down relative to the content. | 886 // The background buffer is upside down relative to the content. |
884 bg_y = bg_last_row - bg_y; | 887 bg_y = bg_last_row - bg_y; |
885 #endif | 888 #endif |
886 int bg_offset = bg_stride * bg_y + bg_x_byte_offset; | 889 int bg_offset = bg_stride * bg_y + bg_x_byte_offset; |
887 if (memcmp(page_bytes + page_offset, | 890 if (memcmp(page_bytes + page_offset, |
888 bg_bytes + bg_offset, | 891 bg_bytes + bg_offset, |
889 damage_width * bytes_per_pixel) != 0) | 892 damage_width * bytes_per_pixel) != 0) |
890 return true; | 893 return true; |
891 } | 894 } |
892 #endif | 895 #endif |
| 896 #endif // OS_ANDROID |
893 | 897 |
894 return false; | 898 return false; |
895 } | 899 } |
896 | 900 |
897 NPObject* WebPluginDelegateProxy::GetPluginScriptableObject() { | 901 NPObject* WebPluginDelegateProxy::GetPluginScriptableObject() { |
898 if (npobject_) | 902 if (npobject_) |
899 return WebBindings::retainObject(npobject_); | 903 return WebBindings::retainObject(npobject_); |
900 | 904 |
901 int route_id = MSG_ROUTING_NONE; | 905 int route_id = MSG_ROUTING_NONE; |
902 Send(new PluginMsg_GetPluginScriptableObject(instance_id_, &route_id)); | 906 Send(new PluginMsg_GetPluginScriptableObject(instance_id_, &route_id)); |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1444 } | 1448 } |
1445 #endif | 1449 #endif |
1446 | 1450 |
1447 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1451 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
1448 int resource_id) { | 1452 int resource_id) { |
1449 if (!plugin_) | 1453 if (!plugin_) |
1450 return; | 1454 return; |
1451 | 1455 |
1452 plugin_->URLRedirectResponse(allow, resource_id); | 1456 plugin_->URLRedirectResponse(allow, resource_id); |
1453 } | 1457 } |
OLD | NEW |